0

Struggling on the simplest of problems!! Grrrr(*3)

I am learning the basics of Python and there is a problem that keeps churning out an error and I've tried many variations. The problem is so simple..... print input 3 times in a row and add an exclamation. The output should be abcabcabc! Using (input) function.

8th Jul 2020, 10:13 AM
Jon Berry
Jon Berry - avatar
5 odpowiedzi
0
I can't remember all of them but I will share what I can remember. I feel like a monkey with a typewriter! Print(3*input ('!')) Print(input*3(!)) Print((input*3)+('!)) The closest one I've got prints !abcabcabc and as follows. I feel I'm missing something very fundamental here! Print(3*input('!')) Thanks for your help.
8th Jul 2020, 10:44 AM
Jon Berry
Jon Berry - avatar
0
Jon Berry , try this : inp = input() print(3 * inp +"!")
8th Jul 2020, 11:17 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
Thanks people. I solved it just now before seeing answers.... just took a little thinking and an entire change of how I look at the world. All done. Thank you for assistance.
8th Jul 2020, 1:15 PM
Jon Berry
Jon Berry - avatar