Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. def rez():
  2. lista_termin = []
  3. fajl = open("termin.txt", "r")
  4. for red in fajl.readlines():
  5. niz = red.strip().split("|")
  6. termin = niz[0]
  7. lista_termin.append(termin)
  8. fajl.close()
  9. while True:
  10. termin1 = input("Unesite sifru termina: ")
  11. if termin1 not in lista_termin:
  12. print("Unesta sifra ne postoji")
  13. else:
  14. rez1()
  15.  
  16.  
  17. def rez1():
  18. lista_red = []
  19. lista_kolona = []
  20. fajl = open("karte.txt", "r")
  21. for red in fajl.readlines():
  22. niz = red.strip().split("|")
  23. redovi = niz[4]
  24. kolone = niz[5]
  25. lista_red.append(redovi)
  26. lista_kolona.append(kolone)
  27. fajl.close()
  28. while True:
  29. red1 = input("Uneti broj reda (1,2,3,4,5,6,7): ")
  30. kolona1 = input("Unesti oznaku sedista (a,b,c,d,e,f,g): ")
  31. if red1 in lista_red and kolona1 in lista_kolona:
  32. print("Uneti red ili sediste je zauzeto: ")
  33. else:
  34. print("Uspesno ste rezervisali kartu")
  35. rezervacija_menu()
  36.  
  37. def menu0():
  38. printmenu0()
  39. command = input("Izaberite komandu: ")
  40. while command not in ("1", "2"):
  41. print("Uneli ste pogrešnu komandu.")
  42. printmenu0()
  43. command = input("Izaberite komandu: ")
  44. return command
  45. def printmenu0():
  46. print("Da li zelite da rezervisete jos karata ?")
  47. print("1.Da")
  48. print("2.Ne")
  49.  
  50. def rezervacija_menu():
  51. komanda = "0"
  52. while komanda != "2":
  53. komanda = menu0()
  54. if komanda == "1":
  55. rez()
  56. login.kupac_menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement