小编K.V*_*Vit的帖子

如何让用户输入一个小数以及一个整数?

如何让用户输入他们想要的任何类型的数字?这是我尝试过的:

a=0
def main():
    x = int(input("Input a number in Celsius to convert it to Fahrenheit"))
    f = (x*1.8)+(32)
    print(f, "degrees Fahrenheit")

a=a+1
while a > 0:
    main()

main()
Run Code Online (Sandbox Code Playgroud)

python

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1