I'm a beginner programmer and I've been completing zedshaw's Learn Python The Hard Way course, however in exercise 26 we are given a flawed code so we can debug it. Although the code was written using Python 2.x I've been re-writing them in Python 3 so I could learn it.
It raises the following error:
Traceback (most recent call last):
File "/home/omar/PycharmProjects/Python_The_Hardway/ex26_Quiz.py", line 76, in <module>
print("We'd have {} beans, {} jars, and {} crates".format(secret_formula(start_point)))
IndexError: tuple index out of range
Here's my code: link
Original code: link (This is the exercise file)
So my questions are:
- Why does it finish with exit code 1?
- Why doesn't it continue executing the code?
- How can I rewrite it using Python 3?
Thank You