They should be backing up their code on Github in the future.
They should be backing up their code on Github in the future.
Change the print to a return and then you can do
print(convert(5))
cost_per_pound = int(x)
total_cost = int(input("How many pounds do you need?")) * cost_per_pound
If you want cents consider using floats instead of integers. I'd recommend taking the Python 3 course on sololearn.
Edit: After looking at your code, you'd be best off making a food class with a name and cost attribute. You could remove some repeated code this way.
Start with the Godot engine, GDscript is a nice language that is very pythonic, or you could use good old cpp, either way it's hard to go wrong with Godot, it has a designated 2d and 3d engine. According to some metrics I saw on YouTube crime games are by far the most popular.
I would use it if it was smooth. The website is terrible on mobile, I can contribute, what technology are you using?
Do you mean making something like functions.py and then using a function contained in that file inside main.py? If so just do "import functions" (or whatever your file name is without the .py) and when calling a function from functions you'd do: "functions.function.py"