Traceback (most recent call last):
File “ex26.py”, line 67, in
print(“We’d have {} beans, {} jars, and {} crates.”.format(formula))
IndexError: tuple index out of range
I don’t understand because if I print “formula” it gives me: (500000.0, 500.0, 5.0)
So if I do this: print(“We’d have {} beans, {} jars, and {} crates.”.format(500000.0, 500.0, 5.0))
It works and it print: We’d have 500000.0 beans, 500.0 jars, and 5.0 crates.
I have search google for this error, not sure understand. It’s related to index …
Thank you very very much for the answer, I had this stuck in the back of my head since then. I tested your solution, and it work. I thought this definition of the asterisk use like this was related to a function thing.