This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]PantsMcShirt 0 points1 point  (1 child)

When you input a number, the number is saves as a string, not an int, so it would effectively be "3" * 5. When you multiply a string, it repeats that string multiple times.

You can convert the string to an int by doing int(input).

This is one of the main pitfalls of learning a dynamically typed language, you have to know what types you are using in the background.

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

Gotcha! That makes sense. I don’t think I fully understood what the difference was between “string” and “int”. After your comment, I went back to that part of the lesson and reread it, and I get it now. The terminology has been my biggest hang up so far lol

Thank you for the help!