Home > other >  # # Python knowledge sharing
# # Python knowledge sharing

Time:03-13

# # Python knowledge sharing

Python is currently written code there are three most common ways of execution

1: CMD mode execution

Benefits: intuitive, input line, perform a line, found the problem easy to found the first time, immediately correct,

The downside: because python language has a very strict rule of indentation, cause sometimes a little space or the circumstance that does not have to switch into English input method of Angle of letters or punctuation marks in all of his own program card there,

We hold direct line add operation, for example, it is very convenient, such as direct calculation of 2 + 3

Enter directly, after we enter the calculation results came out, not only can calculate integer, also can calculate the decimal, the computer industry not decimal, called floating point Numbers,

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C: \ Users \ Administrator> Python

Python 3.6.6 (v3.6.6:4 cf1f54eb7, Jun 27, 2018, 03:37:03) [MSC v. 1900 64 - bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

> 1 + 2

3

> 5/2

2.5

> 3.2 + 2.5

5.7

>

* * * * * * * * * * * * * * * * * * * *

If you need to perform the logic operation, so it's ok to,

If you ever use python2. X, probably your code, but you in python3. X that executes, there will be a

SyntaxError: Missing parentheses in the call to 'print'. Did you mean the print (" a is not 0 ")?
  • Related