client_dict = {"NeQua":"High","EmVol":"Moderate","RiVam":"High","EdLis":"Moderate"}
Intensity_sports = {"High":["swimming","aerobics"],"Moderate":["Basketball","Hiking"]}
def main():
def clientID_choice():
global clientid,intensity
clientid = input("What client would you like to edit?:")
while clientid not in client_dict:
clientid = input("\nPlease enter the correct client\nWhat client would you like to edit?:")
intensity = client_dict[clientid]
print("\n"+clientid,"has a",intensity,"intensity\nThe reccomened sports are:")
for sports in Intensity_sports[intensity]:
print("//",sports)
clientID_choice()
def resultInput():
time = []
for sports in Intensity_sports[intensity]:
time_spent = int(input("Please select the minutes spent on",sports))
while not 0 <= time_spent <= 120:
time_spent = int(input("Please select the minutes spent on",sports," between 0 and 120"))
time.append(time_spent)
total_time = 0
for time_spent in time:
total_time += time_spent
print("\n"+clientid+"'s total time spent is",total_time,"minutes")
resultInput()
def again():
anotherRecord = input("Do you wis to enter another record? Type yes or y or no or n")
while anotherRecord.lower() != "yes" and anotherRecord.lower() != "y" and anotherRecord.lower() != "no" and anotherRecord.lower() != "n":
anotherRecord = input("Please answer again. Yes or No?")
if anotherRecord.lower() == "yes" or anotherRecord.lower() == "y":
print("You will now enter a new client record")
main()
else:
print("Thank you")
again()
main()
time_spent = int(input("Please select the minutes spent on",sports))
TypeError: input expected at most 1 arguments, got 2
Why do I get TypeError: input expected at most 1 arguments, got 2 for this code (python) [duplicate]
-
doc input only take one argumentAfriyandi Setiawan– Afriyandi Setiawan2015-03-01 05:38:06 +00:00Commented Mar 1, 2015 at 5:38
Add a comment
|
1 Answer
input() only takes one argument.
time_spent = int(input("Please select the minutes spent on",sports))
^
To fix you can use this syntax
time_spent = int(input("Please select the minutes spent on {}".format(sports))
1 Comment
Rishi Vamatheva
How would I fix it so that it would display the sports recommened for them?