pycharm the first program:
File->New Project,new->directory,new->Python File
1, the operator
+ - * / **% //
determines whether contained therein: in not in the results: Boolean (True False)
added:
first calculation, the execution order in brackets: front to back
results
True or ==> True
True and = => continue
False or ==> continue
False and == "False
The result is the value of
an arithmetic operation
a = 10 * 10
assignment operator
a = a + 1 a + = 1
the result is a Boolean
comparison operation
a = 1 <5
logical operation
a = 1> 6 and 1 == 1
member operator
a = "Q" in "day to ask"
2, the basic data types
Digital int
bit_length
string str
# EndsWith, to what end Test = " hearewa " V = test.endswith ( ' A ' ) Print (V) results True
# The Find next start looking from, find the location of # index also find, can not find the error the Test = " hearaewa " v = test.find ( ' A ' , 5, 8 ) Print (v) the results of 7
# The format, will replace the placeholder a string to a specified value Test = ' I AM {name}, Age {A} ' V1 = test.format (name = ' DA ' , A =. 19 ) V2 = Test .format_map ({ ' name ' : ' FEI ' , ' A ' : 18 is }) Print (V1) Print (V2) results I AM DA, Age . 19 I AM FEI, Age 18 is
# encode
# decode
#isalnum () string contains only letters and numbers
List list
Ganso tuple
dictionary dict
Boolean value bool