2024年6月2日发(作者:)
print("d的数据类型是:", type(e), "="*5, "e的值为:", e)
print("f的数据类型是:", type(f), "="*5, "f的值为:", f)
print("e的数据类型是:", type(g), "="*5, "g的值为:", g)
# d的数据类型是:
# f的数据类型是:
# e的数据类型是:
转换为复数类型
a = 1
b = 3.14
c = "2"
h = complex(a, b)
i = complex(b, a)
j = complex(c)
print("h的数据类型是:", type(h), "="*5, h)
print("i的数据类型是:", type(i), "="*5, i)
print("j的数据类型是:", type(j), "="*5, j)
# h的数据类型是:
# i的数据类型是:
# j的数据类型是:


发布评论