- Joined
- Oct 14, 2022
- Messages
- 1
- Reaction score
- 0
Hello.
I've been trying for days to fix this error, but to no avail.
This is the code:
It is throwing the error when print("We'd have {0} jelly beans, {2} jars, and {1} creates.".format(secret_formula(start_point))) is called.
Any help would be greatly appreciated.
Thanks.
I've been trying for days to fix this error, but to no avail.
This is the code:
Python:
def secret_formula(started):
jelly_beans = started * 500
jars = jelly_beans / 1000
crates = jars / 100
return jelly_beans, crates, jars
start_point = 10000
jelly_beans, jars, crates = secret_formula(start_point)
print("With a starting point of: {}".format(start_point))
print("We'd have %d jelly beans, %d jars, and %d crates." % (jelly_beans, jars, crates))
start_point = start_point / 10
print("We can also do that this way:")
print("We'd have {0} jelly beans, {2} jars, and {1} creates.".format(secret_formula(start_point)))
It is throwing the error when print("We'd have {0} jelly beans, {2} jars, and {1} creates.".format(secret_formula(start_point))) is called.
Any help would be greatly appreciated.
Thanks.