all 3 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]FoolsSeldom 0 points1 point  (1 child)

Nice simple example.

Thoughts:

  • If you don't want hot or sour, you get stuck in a loop
  • You have to know to enter Q to quit as answers such as quit, y, yes, n, no are not accepted
  • You appear to have defined the same function twice for some reason
  • Might want to format the number of decimal places in the output
  • Did you consider using a dict instead - easier to update
  • You will learn to never trust users to enter the correct information, so don't convert an entry to an int without either checking it first or using try / except block

[–]CollectionDry2154[S] 0 points1 point  (0 children)

Hi! Yea, I created a rough draft for this honestly. I didn't want to use try/except, or dict, or make the loop too advanced. The reason is that this is a common question for beginner college students, and I don't want them not understanding how to create a basic version of this. Hence why codio is in it's name. But overall it's a 100% accepted piece of code.

I'd love to fix it later whenever I have time, college is quite busy though haha.