python2.x与python3.x区别部分
1.print
python2.x中:
print "hello world" #一条语句
python3.x中:
print("hello world")#print()为函数
2.除法(/)
python2.x中:
10/2 #结果是5 10/(2.0) #结果是5.0 (10.0)/(2) #结果是5.0 (10.0)/(2.0) #结果是5.0
python3.x中:
10/2 #结果是5.0
1.print
python2.x中:
print "hello world" #一条语句
python3.x中:
print("hello world")#print()为函数
2.除法(/)
python2.x中:
10/2 #结果是5 10/(2.0) #结果是5.0 (10.0)/(2) #结果是5.0 (10.0)/(2.0) #结果是5.0
python3.x中:
10/2 #结果是5.0
相关推荐