0 Basic Python3 Experience-Python3 study notes-Python3 Basics

Source: Internet
Author: User

Basic preheating

Print () prints each string sequentially, encounters a comma "," prints a space, can print an integer, or calculates the result

Python provides an input (), which allows the user to enter a string and store it in a variable.

#开头的语句是注释, the comment is visible to the person, can be any content, the interpreter ignores the comment.

Each of the other lines is a statement that, when the statement ends with a colon ":", the indented statement is treated as a block of code.

It is important to note that Python programs are case-sensitive

Data Type

Python's data types include integers, floating-point numbers, strings, Boolean values, null values, dictionaries, lists, variables, and constants, among other types of data, and also allows the creation of custom data types;;

The Python string also has the escape \, the character \ itself also to escape, so \ \ means the character is \;

If there are many characters in the string that need to be escaped, you need to add a lot of \, in order to simplify, Python also allows to use R ' ' to indicate that the internal string is not escaped by default, if you decide to write too many rows, do not want each row with/n, you can use the "" "..." form to write:

Print ("' Line1

Line2

Line3 ")

The output is the same as the end Plus/n:

Line1

Line2

Line3

Boolean values can be operated with and, or, and not. The and operation is the same as the operation, and only all the results of the true,and operation are true; or operations are or operations, as long as one of them is the result of a true,or operation is a true not operation is a non-operation, it is a single-mesh operator, which turns true to false, False to True Boolean values are often used in judgments:

0 Basic Python3 Experience-Python3 study notes-Python3 Basics

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.