Old boy python video tutorial: First week

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.