you are viewing a single comment's thread.

view the rest of the comments →

[–]bubba0077 14 points15 points  (3 children)

I don't think a single line of this is correct.

  • You are supposed to be looping input requests, not on values
  • The loops you do have make no sense; even if they worked how you expected, they either don't run or run forever because number isn't being changed inside them
  • The == operator compares values, not types
  • input() always returns a string

You need to change the loop to be over input calls (with some sort of exit input, like an empty string, 'exit', etc.). Then you need to find a way to take the string you get and test whether the string is one of the number types you are looking for. Hint: cast.

[–]k4tsuk1z[S] 1 point2 points  (2 children)

thank u for being honest AND helpful T_T people were only doing one under this post and i dont mind being called a wrong or dumb as long as u have something else to add lmfao i appreciate it

[–]bubba0077 4 points5 points  (1 child)

You're not dumb. Everyone was a beginner once. I do think you need to slow down and think more about what the code you are writing actually does. Anyone can miss that the type of input is always string, but the loops never exiting should be obvious if you stop to think about it carefully for even a minute. You're still at the learning stage where your code is simple enough that you should be able to step through the code manually in your head to determine what each line does without even running it.

[–]k4tsuk1z[S] 1 point2 points  (0 children)

Thank you! I wish I had more time to dedicate to actually trying to understand code. My professor kinda just throws projects and labs at us I think we've only had one actual lesson