python_coursera_RICE 第一周

IDE 

codeskulptor3(python3)/codeskulptor(python2)

Atom

print:

python3 => print("balabala")

python2 => print "balabala"

幂运算 

a**b

平方根 => number**0.5

类型转换

int(3.7) => 3    int(-3.7) => -3

print(3+6.7)

3 =>3.0 =>3.0+6.7 =>9.7 乘法相同

除法

division always gives me back a floating point number

print(8/2) => 4.0

print(8//2) => 4

float//float => float

Error

变量未定义(SPELL错误)、符号的匹配问题、类型错误

错误的列表:点击打开链接

函数

函数调用的6个过程:

1. create a new frame for the function call

2. compute values of arguements to function call

3. assign values to paraments of the function

4. execute the body of the function

5. return a value from the function to global frame

6. resume execution of global frame

你可能感兴趣的:(python基础)