自动类型转换 Number ( int float bool complex)
"""
精度从低到高 bool < int < float < complex
自动类型转换,默认从低精度向高精度进行转换(从低到高)
"""
1.bool + int
'''
True => 1
False => 0
'''
res = True + 100
print(res)
2.bool + float
"""
True => 1.0
False => 0.0
"""
res = True + 3.5
print(res)
3.bool + complex
"""
True => 1+0j
False => 0j
"""
res = True + 3-90j
print(res)
4. int + float
'''
4 => 4.0
'''
res = 4 + 3.9
print(res)
5.int + complex
'''
5 => 5+0j
'''
res = 5 + 3-1j
print(res)
6.float + complex
'''
8.8 => 8.8 + 0j
'''
res = 8.8 + 3.1+1j
print(res)