Imports in a lemonade stand project

I am trying to code a lemonade stand game(modeled after the one on cool math games) and im trying to seperate everything into different files for ease of access and i get extra credit from my teacher if i do. The only problem is i cant for the life of me figure out why the imports arent working :
im using the: from buy import *. idk if there is another kind of import that would work better.

one last thing. Everything was in the same file before i changed it and all i did was cut them to another file and made minor adjustments. please let me know what i would need to do within the next 3 days because i have an exam on this on thursday
https://replit.com/@DEVONHOLLOWAY1/the-real-lemonade-stand#main.py

idk if i formatted this right but id apreciate any help possible

2 Likes

It seems the error you’re getting (TypeError: %i format: a number is required, not str) is not actually because of the imports, but rather you’re trying to use a string where a number is expected…

1 Like

yeah ik i saw that but i also see errors for my imports too

image
this is the errors i was talking about(top 3)

PLUS
the str thing but i have no idea where to change that so ill hve to look

Try import buy etc instead of from buy import *. Then wherever you use a variable or method from buy:

import buy

buy.some_variable
buy.some_function("Hello world!", 123)

you aren’t converting your input to an int in line 8. Also, to simplify this bit:

print(
    f"""
You have:
${dollars}
{lemons} lemons
etc"""
)
1 Like