0

I am in an intro to programming class and we're making a calculator to figure out how many times a human heart has beaten given the number of years someone has been alive, and I keep getting unexpected EOF while parsing on the last line of code, can someone help me figure out why?

input("What is your name? ")
age= float(input("How old are you? "))
print("The average human heart beats 70 times a minute.")
beats_per_hour = 70 * 60
beats_per_day = beats_per_hour * 24
beats_per_year = beats_per_day * 365
beats_age = beats_per_year * age

print(format("Beats per minute: 70"))
print(format("Beats per hour:",beats_per_hour))
print(format("Beats per day:",beats_per_day))
print(format("Beats per year:",beats_per_year))
print(format("Your heart has taken",beats_age,"beats, since you were born.")enter code here
Kat R.
  • 9
  • 1

1 Answers1

0

I believe that your immediate problem is that you forgot the closing parenthesis on the last line: note how you have only one R_PAREN at the end of that one, but two on all the others. Also, do you want to save the user's name in line 1?

Here's a link to help with keyboard input.

Prune
  • 76,765
  • 14
  • 60
  • 81
  • Now it's not calculating the results, it's giving me a "must be str not int" I have not learned that yet in class. – Kat R. Sep 04 '15 at 00:49
  • You're not using the format function properly, and I don't understand what you're trying to do with it. Just remove the word "format" and one set of parenthesis in all the print statements, and you should be in business. The program is calculating the results but it's not printing them; you are actually printing the result of the call to format, and since those calls aren't right you get the error before you get any output. – Paul Cornelius Sep 04 '15 at 01:52
  • WEll everything is calculating properly, and has given me the result, but how do I put commas to seperate values in number in my text, so that it shows up like 777,654,000 instead of 777654000.0? – Kat R. Sep 04 '15 at 21:45
  • http://stackoverflow.com/questions/1823058/how-to-print-number-with-commas-as-thousands-separators – Prune Sep 08 '15 at 16:03