+ 1
please answer
2 odpowiedzi
+ 10
When you multiply a string by a number you get repetitions, e.g., so
print("Ha" * 3) gives HaHaHa.
The input() function always outputs a string, so if you want an integer (or float), use 「HAPPY TO HELP」 's suggestion, i.e. int(input()) or float(input())
+ 1
Don't forget that input() stores everything in string by default. Thus your '5', when multiplied by 5 goes as '5'*5 ('5' + '5' + '5' . . . )
And, actually, I am to be considered new to coding myself, but your tags are kind of an abuse.
SoloLearn's first chapter covers all of the questions of yours, as well as data types and how one works with another. Check Python Tutorial: Basic Concepts - String Operations (3/3)