In [5]:
def functionOne():
print("this is function 1")
def functionTwo():
print("this is function 2")
counter=0
while counter < 5:
print("my counter is {}".format(counter))
answer = input("enter a 1 or a 2 ==>")
if answer =="1":
functionOne()
elif answer =="2":
functionTwo()
else:
print("you didn't type 1 or 2")
counter += 1
print("goodbye")
my counter is 0 enter a 1 or a 2 ==>1 this is function 1 my counter is 1 enter a 1 or a 2 ==>2 this is function 2 my counter is 2 enter a 1 or a 2 ==>1 this is function 1 my counter is 3 enter a 1 or a 2 ==>1 this is function 1 my counter is 4 enter a 1 or a 2 ==>2 this is function 2 goodbye
In [ ]:
In [ ]: