- 4
Write a program to take x and y as input and output the string x, repeated y times. Sample Input hi 3 Sample Output hih
What is the answer?
23 Respostas
+ 8
simply
Write a program to take x and y as input and output the string x, repeated y times.
x = str(input())
y = int(input())
print(x * y)
+ 7
print(input() * int(input()))
Output:
hihihi
+ 4
Did anyone run the code and it passed becaz i failed and im getting frustrated
+ 1
Thx
+ 1
it keep appearing only twice and i am sure i put in the right code
+ 1
x=str(input())
y=int(input())
print(x*y)
+ 1
x=str(input(hi))
y=int(input(2))
print(x*y)
0
x= input()
y= int(input())
print(x * y)
0
I am not getting answer
0
not getting answer at all.....trying so many time
0
Thanks!
0
x=input()
y=input()
print(str(x) * int(y))
0
x=str(input())
y=int(input())
print(x*y)
0
x=input()
y=int(input())
print(x*y)
0
x=input()
y=int(input())
print(x*y)
0
ok this is a very confusing one and it took me a bit to understand. The input is whatever the question is providing not that you physically have to use "HI" as that is just a sample. When you are in the template it mentions what the expected output should be which is the word "cool" multiplied twice. Sadly they shouldnt have provided that sample as it is what derailed me from continuing for a week as i grew very frustrated.
The answer to this is:
x=input()
y=2
print(x*y)
0
This is the Solution
x=input('')
y=int(input(''))
print(x*y)
0
To getting answer to me
0
Ive tried all these possible solutions,,none of them working
0
x=str(input())
y=int(input())
print(str(x) * y)
good luck ^___^