一、基本用法
1、print功能
1 .print(1)
1.1 print字符串
print(“we’re going to do something”)
1
we’re going to do something
1
print(‘we’re going to do something’)
1
we’re going to do something
1.2 字符串叠加
print(‘apple’+‘car’)
1
applecar
1
print(‘apple’+‘4’)
1
apple4
1.3 简单运算
print(1+2)
1
3
1
print(int(‘1’)+2)
1
3
1
print(float(‘1.2’)+2)
1
3.2
2、基础数学运算
1
2
1
1-1
1
0
1
2*2
1
4
1
2**2
1
4
平方运算,不能是2^2
9//4
2