-2
有没有办法让代码行在不同的代码行上继续?例如:Python:使代码在不同的行上继续
a = raw_input("1 or 2")
if a == "1" :
a = raw_input("3 or 4")
if a == "3" :
*line of code that makes the script progress at line #14*
if a == "4" :
*line of code that makes the script progress at line #14*
if a = "2" :
a = raw_input("5 or 6")
if a == "5" :
*line of code that makes the script progress at line #14*
if a == "6" :
*line of code that makes the script progress at line #14*
print ("chocolate")
(^line #14^)
你有更好的例子,更接近你的真实世界的用例吗?这个例子可以简化为'if int(a)<7:print('chocolate')'。 –