Answer:
def _main_():
print('Are you Sure you want to quit ? y/n')
#take user input
user_input=input()
if user_input=='n':
while(user_input!='q'):
#Provide option on the User Screen
print('Welcome to the fitness center. What would you like to do?')
print('[1] Enter 1 to take a bike ride.')
print("[2] Enter 2 to go for a run.")
print("[3] Enter 3 to climb a mountain.")
print("[4] Enter 4 to go swimming.")
print('[q] Enter q to Quit!.')
#Simple if Else
choice=input("\nWhat would you like to do? ")
if choice=='1':
print("\n Here's your bike. Grab a helment from the rack. Have fun!\n")
elif choice == '2':
print("\n Here are some sneakers. Run fast!\n")
elif choice == '3':
print("\n Here's a map. Can you leave a trip plan for us?\n")
elif choice == '4':
print("\n Don't pee in the pool. Good Luck!\n")
elif choice == 'q':
print("\n Thanks for playing. See you later.\n")
else:
print("\n I don't understand that choice, please try again. \n")
user_input=choice
#Function for printing favorite color
def name(name,color):
print(name+"'"+' '+'favorite color is '+color)
def phone(brand,model):
print(brand+' '+model)
def arbitary(*argv):
li=[]
for i in argv:
li.append(i)
print(sum(li))
name('abhi','blue')
name('sunny','black')
name('rahul','silver')
phone('iphone','8 plus')
phone('samsung','Note 3')
phone('xiomai','8')
arbitary(1,2,3)
arbitary(3,5)
Explanation:
The program function will perform these functions;
Take in a sequence of arbitrary length.
Write a function that adds the given numbers together and prints the sum.
Then add any other numbers that were sent to the arbitrary number of arguments and print the results