Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def login():
- username=raw_input("Username :\t")
- password=raw_input("Password :\t")
- if username=="Admin_Fatimah" and password=="1994":
- return username
- else:
- return 0
- class car:
- name = None
- speed = 0
- brand = None
- class mycar(car):
- def out(self):
- count=1
- while count<=10 :
- print("\n *****************************")
- print("\tCar name :\t"),format(self.name),("\n\tCar speed :\t"),format(self.speed),("\n\tCar brand :\t"),format(self.brand)
- print("\n *****************************")
- count+=1
- def main():
- print("### The ArabCar company welcomes you to the car system ###\n")
- print("Please enter the correct data to login:")
- user = login()
- if(not user== 0):
- print("welcome "),user,("\n Please enter the name car to print its data list (BMW ,Ford ,Lexus or All) : ")
- carname=raw_input("Car Name:")
- coupe = mycar()
- coupe.name = 'BMW 440i Coupe '
- coupe.speed = 250
- coupe.brand = 'BMW'
- focus = mycar()
- focus.name = '2017 Focus RS'
- focus.speed = 165
- focus.brand = 'Ford'
- Is = mycar()
- Is.name = 'IS 2017 Lexus'
- Is.speed = 241
- Is.brand = 'Lexus'
- if carname=="BMW":
- coupe.out()
- elif carname=="Ford":
- focus.out()
- elif carname=="Lexus":
- Is.out()
- elif carname=="All":
- coupe.out()
- focus.out()
- Is.out()
- else:
- print("Sorry.. we don't have this car..")
- else:
- print("Sorry.. you are not Admin..")
- if __name__ == "__main__": main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement