A Python Training

# After-school summary
Today is the first day of summer training, tank teacher is very young, very affinity, but also great sense of humor, but the students are obviously high cold, hope that teachers will not be so embarrassed. The first day learning Python
Tank teacher education program is also very good, I did not feel we are students Jike would speak about the so profound, but is very patient basis from talking to us. At the same time the teacher teaching is also very unique, easy to attract a large
family attention. The first day we mainly learn some basic Python language, for example, some of the basic operating variables constant, the user interacts with the program, as well as the data type and the Python language. After a day of school
learning that we have a basic understanding of Python. Looking forward to tomorrow's learning!
# Homework
name = ' Alex ' Print (name.strip ()) Print (name.startswith ( ' Al ' )) Print (name.endswith ( ' X- ' )) name1=name.replace('l','p') print(name1) print(name.split('l')) print(name.upper()) print(name.lower()) print(name[3]) print(name[0:4]) print(name[3:5]) print(name.find('e')) print(name.strip('X'))
#课堂笔记
print('hello world')
# Variable values bound to the variable
name = ' yanshun '
Print (name)
# same value stored in the same address
NAME1 = ' Tank '
NAME2 = ' Tank '
Print (ID (NAME1))
Print (ID (NAME2) )
# constants defined in capital letters
# not so many restrictions python language, most of them are considered to be limiting, the amount of capital encounters generally defined as constants do not modify the
# user to interact with the program
# enter the iNPUT ()
# output print ()
iNPUT = name ( ' enter name ' )
print (name)
# type determines the type of the variable
# iNPUT is any data in the input string
print(type (name))
# single line comment #
# multi-line comment "" "or '' '
# Python automatically identify the type of
str1 = ' Hello World '
Print (str1 [0:. 5]) # Hello
' ''
str1 = ' month consumption% s, balance D% '% (' 100 ', 50)
Print (str1)
str2 =' month consumption% s, balance D% '% (' 100 ',' 50 ')
Print (str2)
' ''
# Lower Upper
'' '
str1 =' aaaa AAAA '
Print (str1.lower ())
Print (str1.upper ())
' ''
'' '
Print (' my name is {}, my age is {} '. format (' cis Yan ',. 3))
Print ( "my name is {0}, I age is {1}'. format ( 'cis Yan',. 3))
Print ( 'my name is {name}, I age {age}'. Format (name = ' Yan cis', Age =. 3))
'' '
' ''
choice = input ( 'Please select [0,1,2]')
Print (choice.isdigit ())
'' '
STR =' Hello '
str1 = str.replace ( ' E ', ' P ' )
Print (str1 )
Print (name.split ( ' E ' ))

 

Guess you like

Origin www.cnblogs.com/ys88/p/11079842.html