1、python的换行、缩进和注释
python代码的组织不像java、C一样用“{}”来控制模块,而是用“换行和缩进”来组织模块,一般情况建议4个空格的缩进。#who big who print
a = 3
b = 4
if a > b:
print(a)
else:
print(b)
2、python的输入和输出#在3.X版本的python里,输入和输出
name = input("what is your name: ")
print(name)
#在2.X版本的python里,输入和输出
name = raw_input("what is your name: ")
print name
3、python的小整数对象池from pip._vendor.distlib.compat import raw_input
print ("please input x and y");
x=raw_input("x=");
y=raw_input("y=");
x=int(x);
y=int(y);
c=x is y;
if c:
print ("x与y相同");
else:
print("x与y不同");
运行结果1please input x and y
x=5
y=5
x与y相同
运行结果2please input x a