1. Rules for variable naming:
1. Variables are assigned before they are used.
2 variables can be letters, underscores, numbers, but cannot start with a number.
The 3 variables are case-sensitive and represent different meanings.
PS: In Python, you just paste the value into a variable, not a store, so you can think of no variable in Python.
2. String
The use of strings is to be noted for consistency
PS: Use of quotation marks in strings
' let\ ' s go '
Result is
3. Use of backslashes
" C:\file " Print "c:\\file"print"C:\file\now" Print= R"C:\file\now"print str
The result is:
Effect of the last three single quotes:
" " I'm a boy, I love life, I'm a foodie, and I'm a literary youth . " " Print str
Or
" " I am a boy,\n, I love life, \ n I am a foodie, I am still a literary youth. Print STR
The results were:
Summing up today, we learned about the use rules of variables, the meaning of strings, the backslash, and the effect of three single quotes.
4. After-school assignments:
daysperyear = 365= = = = Daysperyear * HoursPerDay * minutesperhour * Secon DsperminutePrint(Result)
Little Turtle Python Video Third lecture (notes and after-school exercise answers)