0

Please help solve problem 14.2 in learning Python.

Somebody wrote code to take a string input and output it, repeated 10 times. However, the code results in an error. x = "hello" print(x * 10) del x x = "oi" print(x * 10) I am unable to split the output. It comes out 10 hello and 10 oi together. Sorry for my english. I'm writing through Google translator.

13th Jan 2022, 6:31 PM
Sung Jin-Woo
Sung Jin-Woo - avatar
3 Respostas
0
I wrote the code.
13th Jan 2022, 6:47 PM
Sung Jin-Woo
Sung Jin-Woo - avatar
0
I just recently started learning Python. So I don't understand some things. Sorry.
13th Jan 2022, 6:49 PM
Sung Jin-Woo
Sung Jin-Woo - avatar
0
Sorry, I didn't express myself correctly. What I mean is that when I print, I get "hellohellohello... and so on 10 times. And then on the next line, "oioioioi.. also 10 times. I can't split into two separate outputs. Because in practice it asks for two tests. One should output "hello" 10 times for test 1 and "oi" 10 times for test 2
13th Jan 2022, 7:05 PM
Sung Jin-Woo
Sung Jin-Woo - avatar