πŸ“– preface


Do what I can, do what I can, do what I can.

The more transparent something is, the more mysterious it is. The universe itself is transparent. You can see as far as you want as you can see, but the more you look, the more mysterious it becomes. – liu

Today’s blogger is going to talk to you about how to use itPythonComments and operators! Do not like spray, if you have suggestions welcome to supplement, discussion!

For more information on installation and sinification, see this post from the bloggerDownload and Install VsCodeAs well asPython series: windows10 to configure Python3.0 development environment!Restart VsCode after installation!


πŸ‘ last Come on! Python annotation

Be sure to use the correct style for modules, functions, methods, and inline comments

Comments in Python are single-line and multi-line:

Single-line comments in Python begin with #, such as: :

Print ("Hello, World!") )Copy the code

Multi-line comments are enclosed in three single quotation marks “” or three double quotation marks “””, for example:

1, single quotation marks (” “)

#! /usr/bin/python3 "" this is a multi-line comment with three single quotes" "print("Hello, World!") )Copy the code

2, double quotation marks (“””)

#! /usr/bin/python3 """ this is a multi-line comment with three double quotes """ "print("Hello, World!" )Copy the code

Here’s an example where we can print a comment for a function:

Def a(): "" this is the docstring" "pass print(a.__doc__)Copy the code

The output is:

This is the docstringCopy the code

πŸš€Python operators!


🎊 last Come on! The operator

Operations can usually be divided into two types according to the final obtained value, that is, the result is a specific value, the result is a bool value, so which results are specific value -> arithmetic operation, assignment operation, which results are a bool value? –> Comparison operation, logical operation and member operation.

  1. Arithmetic operations

2. The assignment operation 3. Comparison operations 4. Logical operations 5. Members of the operation


πŸŽ‰ finally

  • For more references, see here:Chen Yongjia’s blog
  • Like the little friend of the blogger can add a concern, point a like oh, continue to update hey hey!