Advertisement
Guest User

Untitled

a guest
Dec 4th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. def login():
  2. username=raw_input("Username :\t")
  3. password=raw_input("Password :\t")
  4. if username=="Admin_Fatimah" and password=="1994":
  5. return username
  6. else:
  7. return 0
  8.  
  9. class car:
  10. name = None
  11. speed = 0
  12. brand = None
  13.  
  14. class mycar(car):
  15. def out(self):
  16. count=1
  17. while count<=10 :
  18. print("\n *****************************")
  19. print("\tCar name :\t"),format(self.name),("\n\tCar speed :\t"),format(self.speed),("\n\tCar brand :\t"),format(self.brand)
  20. print("\n *****************************")
  21. count+=1
  22.  
  23.  
  24.  
  25. def main():
  26. print("### The ArabCar company welcomes you to the car system ###\n")
  27. print("Please enter the correct data to login:")
  28.  
  29. user = login()
  30. if(not user== 0):
  31. print("welcome "),user,("\n Please enter the name car to print its data list (BMW ,Ford ,Lexus or All) : ")
  32. carname=raw_input("Car Name:")
  33. coupe = mycar()
  34. coupe.name = 'BMW 440i Coupe '
  35. coupe.speed = 250
  36. coupe.brand = 'BMW'
  37. focus = mycar()
  38. focus.name = '2017 Focus RS'
  39. focus.speed = 165
  40. focus.brand = 'Ford'
  41. Is = mycar()
  42. Is.name = 'IS 2017 Lexus'
  43. Is.speed = 241
  44. Is.brand = 'Lexus'
  45.  
  46. if carname=="BMW":
  47. coupe.out()
  48. elif carname=="Ford":
  49. focus.out()
  50. elif carname=="Lexus":
  51. Is.out()
  52. elif carname=="All":
  53. coupe.out()
  54. focus.out()
  55. Is.out()
  56.  
  57. else:
  58. print("Sorry.. we don't have this car..")
  59.  
  60. else:
  61. print("Sorry.. you are not Admin..")
  62.  
  63.  
  64. if __name__ == "__main__": main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement