int
,没有long int
也没有 long long int
import sys
print(sys.maxsize) #可获取系统支持的最大整数
#用小数点表示
a = 0.06
print('浮点数有小数点 a = ',a)
#科学计数法 6e2相当于6*10的2次方 此时b = 600
b = 6e2
print('6e2相当于6*(10的2次方) 此时 b = ',b)
#E的用法和e相同
c = 5E3
print('5E3相当于5*(10的3次方) 此时 c = ',c)
a+bj
或者comlex(a,b)
表示real
函数获取实数部分,imag
获取虚数部分conjugate()
来求共轭复数#复数的实现
a = 5 + 2j
b = complex(5,2)
print(' a = ',a)
print(' b = ',b)
#用real函数获取实数部分,imag获取虚数部分
c = a.real
print('a的实数部分:a.real = ' , c)
d = a.imag
print('a的虚数部分:a.imag = ' , d)
#共轭复数
e = a.conjugate()
print('a的共轭复数为:a.conjugate() = ',e)
True
和 False
两种值a = True
b = False
print('a = ',a)
print('b = ',b)
运算 | 含义 |
---|---|
and | 两边同时为True,才为True |
or | 两边有一个是True , 就是True |
not | 取反 |
a = True
b = False
# and
print('a and b = ', (a and b))
# or
print('a or b = ', (a or b))
# not
print('not a = ', (not a))
type
函数来查询数据类型a = 1
print('a的数据类型为:',type(a))
b = 2.34
print('b的数据类型为:',type(b))
c = False
print('c的数据类型为:',type(c))
d = 1 + 2j
print('d的数据类型为:',type(d))
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。