1
Variable: A variable is a word, only a single value
1 python data types interage, floats, booleans, string, etc.
2 Python is a case-sensitive language
3 python variables can be overwritten at any time
2 Pyt
h
on multiline comment is through "" "" * * * *
"""
"To achieve the
3 Pyth
o
n There are 6 kinds of arithmetic operators
+,-, *,/,** ( power ),%
4 Python inside x^m, written x**m
5
a String is passed
'
' or ' "
wrapped in a string
6
Python is through
\
to implement the escape character.
7
We can use
""
to avoid the appearance of escaped characters
Set the variable fifth_letter to the fifth character of Monty
Fifth_letter = "MONTY" [4]
Print Fifth_letter
8
describes the first method of string,len () to find the length of the string
Parrot = "Norwegian Blue"
Print Len (Parrot)
9
describes the second method of String , Lower () converts all uppercase letters to lowercase letters
Parrot = "Norwegian Blue"
Print Parrot.lower ()
1
0
describes the third method of String , Upper () puts all the
Small
write letters into
Big
Write Letters
convert lowercase letters in parrot to uppercase and print
Parrot = "Norwegian Blue"
Print Parrot.upper ()
One
You can use + to connect two strings
1
2 Introduction str () converts a number to a string
Set a variable pi value to 3.14 to convert pi to string
PI = 3.14
Print str (PI)
Print "The value of pi is around" + str (3.14)
Python base point record 1