Recognize and try Python
Remark: old boy python video tutorial, video from the network, here to share, invasion delete
For me, the first week of the video mainly answers the following questions:
1. What are the three main features of Python?
A: Explanatory, dynamic type (data type checking is done during run time), strong type definition (a variable can only store one type of data). "See more"
2. Should I use Python2 or Python3?
A: Although the Python2 application is also very wide, although some frameworks and libraries do not yet support Python3, but Python3 is the future of Python, of course, it is worth choosing!
3. How do I set the Python default template in Pycharm?
A: The default template can add some information to your newly created Python file, such as adding an interpreter declaration automatically, adding author information automatically, and so on.
Setup method: Sittings---code Style---File and code Templates---Python Scripts
4. What are the characteristics that make me feel unexpected?
Answer: The variable name in Python3 can be Chinese!!!
A: While can be used in conjunction with else:
Count = 0 while Count <: print( count)+ = 1Else : Print ("The variable count is already equal to 10, stop the loop ")
5. Python formatted output:
Two variables defined: name = "Barney", age = 26, format them output
# Method One Print ("'Name:%sage:%s' "% (name, age))
# Method Two Print ('Name: {user_name}age: {user_age}'. Format (user_name=name, user_age= age) # user_name and user_age are free to play
# Method Three Print ('name: {0}age: {1}'. Format (name, age) # name, the order of age is important
6. Python Ciphertext input:
Import= Getpass.getpass ("")# hint "Password:" optional, casual # in command-line mode, ciphertext will not be displayed, just like entering a password in linux # This function is not available in Pycharm
7. For loop: The Official document for range ()
Old boy python video tutorial: First week