- 1

Pls help with this input question

hi=input() 3=int(input()) print(hi*3) would this equal to, hihihi?

1st Dec 2021, 11:01 AM
Kav
6 Answers
+ 3
Run this code. It will ask you for input. Put this: hi 3 https://code.sololearn.com/cAxnCh2qYg24/?ref=app Hope this helps.
1st Dec 2021, 11:08 AM
Lebi
+ 2
No, 3=int(input()) would result in error. Python thinks you are trying to assign 3 as a variable to int(input()) and raises an error due 3 being an invalid variable name.
1st Dec 2021, 11:10 AM
Seb TheS
Seb TheS - avatar
+ 1
Seb TheS I think Kav means: If the first input equals hi and the second 3. But you are rigth variables names can't have numbers and some special symbols.
1st Dec 2021, 11:14 AM
Lebi
+ 1
The output of a string multiplied by a number is that string repeated that number of times. https://code.sololearn.com/cxD3LrWiNJPW/?ref=app If you still don't understand see the lesson 9.1 String Operations on the Python for Beginers course.
1st Dec 2021, 11:29 AM
Lebi
0
Nothing is working
is there a different way?
1st Dec 2021, 11:25 AM
Kav
0
Code is in Python, no need to tag Java ☝
1st Dec 2021, 2:17 PM
Ipang