I need help with my code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I need help with my code

print(input("Pick any color: ")) print(input("pick any number: ")) print(int(input("Type a 2 digit number ") * int(12))) this is giving me the 2 digit number 12 times. I typed in int so why isn't multiplying the numbers?

3rd Apr 2017, 4:06 PM
Abbie Ruperto
Abbie Ruperto - avatar
2 Answers
+ 13
Try this instead: print(int(input("Type a 2 digit number ") )* int(12))
3rd Apr 2017, 4:29 PM
Michael Foster
Michael Foster - avatar
+ 7
Change the third line to print(int(input("Type a 2 digit number ") )* 12) With your position of parentheses, you use the *12 operation on the string containing your two digit number, which just concatenates 12 of them together.
3rd Apr 2017, 4:36 PM
Tob
Tob - avatar