MCPcopy Create free account
hub / github.com/geekcomputers/Python / view

Function view

Hotel-Management.py:260–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258
259
260def view():
261 with open("Management.txt") as File:
262 dictionary = json.loads(File.read().replace("'", '"'))
263
264 dict_num = dictionary.get("Room")
265 dict_len = len(dict_num)
266 if dict_len == 0:
267 print("\nThere is no data in our database\n")
268 menu()
269
270 else:
271 listt = dictionary["Room"]
272 a = len(listt)
273
274 index = 0
275 while index != a:
276 listt_fname = dictionary.get("First_Name")
277 listt_lname = dictionary.get("Last_Name")
278 listt_phone = dictionary.get("Phone_num")
279 listt_type = dictionary.get("Room_Type")
280 listt_days = dictionary.get("Days")
281 listt_price = dictionary.get("Price")
282 listt_num = dictionary.get("Room")
283
284 print("")
285 print("First Name:", listt_fname[index])
286 print("Last Name:", listt_lname[index])
287 print("Phone number:", listt_phone[index])
288 print("Room Type:", listt_type[index])
289 print("Days staying:", listt_days[index])
290 print("Money paid:", listt_price[index])
291 print("Room Number:", listt_num[index])
292 print("")
293
294 index = index + 1
295
296 exit_menu()
297
298
299def exit():

Callers 1

menuFunction · 0.85

Calls 3

menuFunction · 0.85
exit_menuFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected