Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The way to python-fundamentals 3

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Assignment:

1. Write a blog every week

2. Write login interface

Enter user name and password

Welcome message is displayed after successful authentication.

Lock after three misses

3. Multi-level menu

Three-level menu

You can choose to enter each submenu in turn.

New knowledge points required: list, dictionary

Data = {"fruit": {"banana": {"Origin": ["Hainan", "Maldives"], "Price": [9.929.9]}, "Apple": {"Origin": ["USA" "Shandong"], "Price": [1.2] 5.5]}, "Litchi": {"Origin": ["Taiwan", "Yunnan", "Guangxi"], "Price": [9351]},} "vegetables": {"cauliflower": {"Origin": ["Hebei", "Henan"], "Price": [257,13]}, "Tomato": {"Origin": ["Huairou", "Yanqing"] "Price": [0.5],}, "seasoning": {"Soy Sauce": {"Brand": ["Haitian", "Lu Hua", "Li Jinji"] "Price": [25.5, 35.5 [15.5]]}, "edible salt": {"Brand": ["Jiuda", "White Elephant"], "Price": [5jue 9]},} } while True: for i in data: print (I) choice = input ("choose to enter 1 > >:") if choice in data: while True: for i2 in data [choice]: print ("\ t" I2) choice2 = input ("enter b to return to the previous menu or select to enter 2 > >:") if choice2 in data [choice]: while True: for i3 in data [choice] [choice2]: Print ("\ t\ t" I3) choice3 = input ("enter b to return to the menu above or select to enter 3 > >:") if choice3 in data [choice] [choice2]: for i4 in data [choice] [choice2] [choice3]: Print ("\ t\ t" I4) choice4 = input ("enter b to return to the upper layer Or enter Q to exit > >: ") if choice4 =" b ": pass elif choice4 = =" Q ": Exit () if choice3 = = "b": break elif choice3 = = "Q": Exit () if choice2 = = "b": break elif choice2 = = "Q": exit () else: print ("input does not exist.") Break

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report