#变量无需申明,可直接赋值
a = 6
print(a)
print(type(a))
#变量的类型可以动态改变,一会是int型,一会是str型
a = “python”
print(a)
print(type(a))
#python3.0
small = 2
big = 9999999999999999
print(small,big)
print(type(small),type(big)) # int , int
// python2.0 int , long
binval = 0b10101
oval = 0o344 # 364+48+4
print(oval)
xval = 0xaf # 10*16+15
print(xval)
floatva = 3.4
floatva2 = -2.3
floatva3 = 3.4*10**5
print(floatva3) # 340000.0
cva1 = 2+3j
cva2 = 3.3-2.3j
print(type(cva2)
print(cva1)
print(cva2)
复数的加法
print(cva1+cva2)
用不同的引号
s1 = “hello ’ python”
print(s2)
s2 = ‘hello ’ python’
+可作为连接运算符
s1 = ‘hello’
s2 = “pyt