Section 15.2 results in undefined variable | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Section 15.2 results in undefined variable

Hey! Iā€™m trying to use inputs to create the phrase ā€œhihihi.ā€ But I keep getting an ā€œundefined variable response for x. I cannot for my life figure out whatā€™s wrong. Any chance any of you might be willing to help an utter newb? Hereā€™s my code: x=input("hi") y=int(input(3)) print(x*y) Thanks!

5th Feb 2022, 12:46 PM
Josh05
4 Respostas
+ 3
Josh05 No as there is input so you should use input function but without passing any argument. x = input() y = int(input() print (x * y)
5th Feb 2022, 12:57 PM
AĶ¢J
AĶ¢J - avatar
+ 2
joshua Meyers Don't write anything inside input() function
5th Feb 2022, 12:49 PM
AĶ¢J
AĶ¢J - avatar
+ 1
Thanks! So, should the code just read: X=ā€œhiā€ Y=int(3) Print(x*y) Thanks!
5th Feb 2022, 12:52 PM
Josh05
0
Iā€™m an idiot. Thanks so muchā€”i really appreciate it!
5th Feb 2022, 1:01 PM
Josh05