Python Basics (Run, pycharm use, comments)

Source: Internet
Author: User

1. File Size conversion Relationship:

1G = 1024M

1M = 1024K

1 k =1024byte

1 B = 8byte

Note: Byte is byte, byte is bit

2. How to run the Python program:

2.1 Interactive environment operation, the flag is >>>,windows environment can use idle, and then F5 run can;

    

2.2 Directly run the file, Windows, the first one of your disk to build a file, for example: E:\PythonExample, and then write a Python program in the file, The suffix name is. py, for example: ex1.py, then run, first enter your disk, find your Python file, such as, and then run Python ex1.py;

    

The IDE in 3.Python is pycharm use, download the installation yourself, then open the first new project, such as:

    

Note: Right-click the custom project name you just made, then new, then Python file, be sure to select Python file, so that is the. py suffix of the Python program Oh, here remember to choose Python file, do not choose other;

    

Then the popup box, such as name, is the file name and does not need a suffix. py, because you chose Python file, so the. py files will be generated automatically, and then click OK, guess what your new file looks like???

    

4. In Python, comments are divided into several categories, how are they defined separately? <1> Single line Comment

Start with #, #右边的所有东西当做说明, rather than the program that is really going to execute, plays an auxiliary role

    # 我是注释,可以在里写一些功能说明之类的哦    print(‘hello world‘)
<2> Multi-line annotations
    ‘‘‘我是多行注释,可以写很多很多行的功能说明        这就是我牛X指出        哈哈哈。。。    ‘‘‘    ‘‘‘ 注意:单引号是英文状态下的哦!        下面的代码完成 ,打印一首诗        名字叫做:春江花月夜        作者,忘了    ‘‘‘

Reply

Python Basics (Run, pycharm use, comments)

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.