Multiple variables python question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Multiple variables python question

Multiple variables python solution I am having difficulties with multiplying multiple varibles X=input(“hi”) Y=input(5) z=x*int(y) Print(z) Output =hi5 Desired input is hihihihihi Can anyone help me out?

13th Oct 2020, 3:41 AM
Julia Tran
Julia Tran - avatar
3 Answers
+ 6
#Try this x=input() y=input() z=str(x)*int(y) print(z)
13th Oct 2020, 4:37 AM
Simba
Simba - avatar
0
Code is correct, the output should be hihihihihi. Try once more and use y=int(input()) directly, though it does not make any difference.
13th Oct 2020, 4:39 AM
Bhavya Ruparelia
Bhavya Ruparelia - avatar
0
x = "hi" y = 5 print( str(x) * int(y))
12th Dec 2021, 9:46 AM
josé manuel
josé manuel - avatar