• 6 Posts
  • 363 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle








  • Honestly, I had a bunch of little confusions. I thought the input() function was only a string until the user typed in a value when prompted, and then it became either an integer value or a floating-point value depending on what you typed in.

    Thanks to Labna@lemmy.world and your other response, I understand that it is always a string regardless until you convert it after the fact.

    Also, I meant to type an asterisk instead of a plus sign when typing over my code snippet into my post. Fixed now.

    Also, to answer your last question, if I do h+r or h*r, I get “5010” for the former (which makes sense) and the standard “can’t multiply sequence by non-int of type ‘str’”, which also makes sense to me now that I understand the above point.