admin管理员组

文章数量:1609966

Print and None

None Indicates that Nothing is Returned,The special value None represents nothing in Python

A function that does not explicitly return a value will return None

Careful: None is not displayed by the interpreter as the value of an expression

Pure Functions & Non-Pure Functions

Nested Expressions with Print

Life Cycle of a User-Defined Function

Names Have Different Meanings in Different Environments

Statement

While Statements

Operators

it comes to division, Python provides two infix operators: / and //. The former is normal division, so that it results in a floating point, or decimal value, even if the divisor evenly divides the dividend:

>>> 5 / 4
1.25
>>> 8 / 4
2.0

The // operator, on the other hand, rounds the result down to an integer:

>>> 5 // 4
1
>>> -5 // 4
-2

These two operators are shorthand for the truediv and floordiv functions.

>>> from operator import truediv, floordiv
>>> truediv(5, 4)
1.25
>>> floordiv(5, 4)
1

本文标签: StructureCSLecturecontrolSpring