from time import sleep
print(" Wellcome ".center(60,"*"))
print("Please enter the number floor.")
class elevatorControlPanel:
def __init__(self):
self.sayac = 0
def whichFloor(self):
self.floorNumber = input("\nEnter the number floor: ")
if self.floorNumber == "":
quit()
else:
return int(self.floorNumber)
def get_number(self, number):
if self.numberFloor == 0:
if self.sayac < self.numberFloor:
print("Elevator is going up {}.Floor".format(self.numberFloor))
sleep(self.sayac / 2)
self.sayac = self.numberFloor
return print("{}.Floor".format(self.numberFloor))
else:
print("Elevator is going down {}.Floor".format(self.numberFloor))
sleep(self.sayac / 2)
self.sayac = self.numberFloor
return print("{}.Floor".format(self.numberFloor))
elif self.sayac < self.numberFloor:
self.sayac = self.numberFloor
print("Elevator is going up {}.Floor".format(self.numberFloor))
sleep(self.sayac/2)
return print("{}.Floor".format(self.numberFloor))
# print("{}.floor".format(self.numberFloor))
# return quit() #İf you want end of elevator all the floor
elif self.sayac > self.numberFloor:
self.sayac = self.numberFloor
print("Elevator is going down {}.Floor".format(self.numberFloor))
sleep(self.sayac/2)
return print("{}.Floor".format(self.numberFloor))
# print("{}.floor".format(self.numberFloor))
# return quit() #İf you want end of elevator all the floor
else:
print("Enter number the floor.")
quit()
def Loop(self):
while True:
self.numberFloor = self.whichFloor()
self.floor = self.get_number(self.numberFloor)
# def showScreen(self):
# message = "\nYou are goin to {}.floor"
# print(message.format(self.numberFloor))
def calistir(self):
self.loop = self.Loop()
if __name__ == '__main__':
floor = elevatorControlPanel()
floor.calistir()