----------menu---------- 1.init carpark 2.car enter 3.car exit 4.show information 5.set 0.exit ----------menu---------- Please Choose:(1-5)
时间: 2023-12-27 07:25:07 浏览: 100
I-Menu Setup 0.9.0.zip
以下是一个示例菜单的Python代码:
```python
def init_carpark():
# 初始化停车场
print("Car park initialized.")
def car_enter():
# 车辆进入停车场
print("Car entered.")
def car_exit():
# 车辆离开停车场
print("Car exited.")
def show_information():
# 显示停车场信息
print("Car park information.")
def set_option():
# 设置选项
print("Option set.")
def main():
while True:
print("--menu--")
print("1. init carpark")
print("2. car enter")
print("3. car exit")
print("4. show information")
print("5. set")
print("0. exit")
print("--menu--")
choice = input("Please Choose:(1-5)? ")
if choice == "1":
init_carpark()
elif choice == "2":
car_enter()
elif choice == "3":
car_exit()
elif choice == "4":
show_information()
elif choice == "5":
set_option()
elif choice == "0":
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()
```
阅读全文