I'm trying to create a program, where the user types a word 5 times and then I plot the results. But I can't get past the first input statement.
import matplotlib.pyplot as plt
import time as t
times = []
mistakes = 0
print("This is a program to help you type faster. You will have to type the word 'programming' as fast as you can 5 times")
input("Press Enter to continue.")
while len(times) < 5:
start = t.time()
word = input("Type the word: ")
end = t.time()
time_elapsed = end - start
times.append(time_elapsed)
if (word.lower() != "programming"):
mistakes += 1
print("You made " + str(mistakes) + " mistake(s).")
print("Now let's see your evolution.")
t.sleep(3)
x = [1,2,3,4,5]
y = times
plt.plot(x,y)
plt.show()
The error message is:
Traceback (most recent call last):
File "C:\Python27\time.py", line 8, in <module>
input("Press Enter to continue.")
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
I'm new and have no clue what I did wrong