I need help with the following:
#Get information from user
print("I'll help you determine how long you will need to save.")
name = input("What's your name? ")
item = input("What is your savings for? ")
balance = float (input("OK, ", name, ". Please enter the cost of the ", item, ": "))
If (balance<0):
print("Looks like you already have saved enough!")
balance = 0
payment = 1
else:
payment = float(input("Enter how much you will save each period:"))
if (payment <=0):
payment = float(input("Savings must be positive. Please enter a positive value:"))
#Calculate number of payments that will be needed
num_remaining_payments = balance/payment
#Present information to user
print (name, ", you must make", num_remaining_payments, "more payments, and then you'll have your ", item, ":")
(When I run I get the following error)
I'll help you determine how long you will need to save.
What's your name? john
What is your savings for? car
Traceback (most recent call last):
File "/Users/terrythompson/Library/Preferences/PyCharmCE2019.1/ scratches/my first program.py", line 5, in <module>
balance = float (input("OK, ", name, ". Please enter the cost of the ", item, ": "))
TypeError: input expected at most 1 arguments, got 5
Please advise.
Thank you