Python Learning notes (i)

Source: Internet
Author: User

Print ('thequick brown fox'jumpsover'thelazy dog  'Thequick brown fox jumps over the The lazy dog

print()Each string will be printed sequentially, and a comma "," will output a space, so the output string is spelled like this:

Name = input (")print('Hello,', name)

Sequence one runs, will first print out please enter your name: , so that the user can follow the prompts, enter the name, the resulting hello, xxx output:

Finally, it is important to note that the Python program is case-sensitive, and if the case is written incorrectly, the program will give an error.

If there is a lot of line wrapping inside the string, it is not good to read in a single line, and in \n order to simplify, Python allows ‘‘‘...‘‘‘ the format to represent multiple lines of content

Print ("'line1 ... line2 ... line3") Line1line2line3
Null value

A null value is a special value in Python, None denoted by. Nonecannot be understood as 0 , because 0 it is meaningful, and None is a special null value.

# -*-coding:utf-8-*-
' Hi,%s, you have $%d. ' % ('Michael', 1000000)
If you're not sure what to use, %sAlways works, it converts any data type to a string:

Python Learning notes (i)

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.