我是python编程的新手,我做了我的第一个basic程序
我必须访问并打印if函数中的局部变量,如果我试图访问它,它显示局部变量可能被引用
这是完整的代码def main():
print("Please place your order by filling the options")
name = input("What is your name ")
while not name.isalpha():
print("invalid name")
age = input("What is your age ")
if not age.isdigit():
print("Please type in correct form")
if age >= "50":
print("you are not allowed!")
sys.exit()
item_1 = "burger"
item_2 = "pizza"
print("what would you like to order?")
print(item_1 + "\n" + item_2)
order = input()
item_1_large = "large burger"
item_1_small = "small burger"
item_2_large = "large pizza"
item_2_sm