python remember the Hello world!

________________________________ This hands-on practice.

Number and expression

Interactive Python interpreter can be used as a powerful calculator.

Result of the division as a decimal, i.e., floating-point (float or floating-point number).

 

If you want to discard the fractional part, i.e. performing integer division, can be double slash:

 

 Here we introduce a power (exponentiation) operator:

 

 Variable (variable) && assignment (assignment)

 

 

Without knowing the value of a variable you can use them when writing programs.

An interesting example:

 

Functions like a small program that can be used to perform certain operations.

Getting primer:

E.g:

abs calculates an absolute value. round rounded, floating-point number rounded to the nearest integer therewith.

# My compiler the somewhat iffy: round (2 // 3) should = 1.0

 

Modules can be considered extensions.

 

 

In case of determining not imported from a plurality of different functions with the same name of the module case, and in many but not all cases, may be used as the import command variants:

 

 from module import function

Python itself provides support for complex numbers.

 

 

Almost all real Python program has a string figure.

Introduction:

Python supports both single and double quotes.

You can get a glimpse:

Strings are spliced :

 

 

 ------------------------------------ first recorded here!

 

Guess you like

Origin www.cnblogs.com/dragondragon/p/11265783.html