+ 1

Somebody wrote code to take a string input and output it, repeated 10 times. However, the code results in an error.

Exercise: 14.4 I tried solving this problem but I couldn't get the output. Please help through this. Python program Input function x=input("Hello") y=int(input(10)) print(x*y)

20th Jan 2022, 4:08 PM
nithya ravi
8 Respostas
+ 3
#try this then x=input() print(x*10)
20th Jan 2022, 4:54 PM
Simba
Simba - avatar
0
Please post your attempt and tag the language you are using
20th Jan 2022, 4:09 PM
Kamil Hamid
Kamil Hamid - avatar
0
I have updated it
20th Jan 2022, 4:12 PM
nithya ravi
0
Ok, so what this programme is ssying hello, and taking an input, and then saying ten and taking another input. Then it is pronting the first input as many times as the second inpuur is in value. If you want to do it ten times, just take out the line which defines y, and replace it with 10 in the third line. That will say print input 10 times. Happy coding!
20th Jan 2022, 4:17 PM
Kamil Hamid
Kamil Hamid - avatar
0
Can you please show me the code
20th Jan 2022, 4:21 PM
nithya ravi
0
I tried this. It shows me a error
20th Jan 2022, 4:29 PM
nithya ravi
0
1. if you want repeat 10 times in a new line: x = input() for i in range(10): print(x) 2. if you want to repeat 10 times in the same line: x = input() print(x*10) 3. if you want to repeat in the same line with the space between repeating string: x = input() print((x+' ')*10) 4. if you want to get repeating number from user: x, n = input(), int(input())
20th Jan 2022, 5:14 PM
Shadoff
Shadoff - avatar
- 2
Sure: x=input(“Hello”) print(x*10)
20th Jan 2022, 4:26 PM
Kamil Hamid
Kamil Hamid - avatar