相关疑难解决方法(0)

如何使程序回到代码的顶部而不是关闭

我试图弄清楚如何让Python回到代码的顶部.在SmallBasic中,你做到了

start:
    textwindow.writeline("Poo")
    goto start
Run Code Online (Sandbox Code Playgroud)

但我无法弄清楚你是如何用Python做到的:/任何人的想法?

我试图循环的代码就是这个

#Alan's Toolkit for conversions

def start() :
    print ("Welcome to the converter toolkit made by Alan.")
    op = input ("Please input what operation you wish to perform. 1 for Fahrenheit to Celsius, 2 for meters to centimetres and 3 for megabytes to gigabytes")

if op == "1":
    f1 = input ("Please enter your fahrenheit temperature: ")
    f1 = int(f1)

    a1 = (f1 - 32) / 1.8
    a1 = str(a1)

    print (a1+" celsius") 

elif …
Run Code Online (Sandbox Code Playgroud)

python python-3.3

9
推荐指数
2
解决办法
22万
查看次数

标签 统计

python ×1

python-3.3 ×1