User input | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

User input

In python , how do you do user input ? So say You input a number for x. And then that number is used later on. I know how to in the coding section of the program , youā€™d do x = whatever . But I want it to come up when I press run it says input number x =

31st Jan 2018, 10:10 PM
Alex Herbert
4 Respostas
+ 1
Thanks thatā€™s what I needed! Now , is only way of inputting the info at the start of the program on the pop up box?
31st Jan 2018, 11:21 PM
Alex Herbert
+ 2
To do that you would need this code: x = input(ā€œInput a numberā€) print(ā€œx = ā€œ, input) #Run: Input a number: 7 #Outputs x = 7
31st Jan 2018, 11:17 PM
Ole113
Ole113 - avatar
+ 2
Yeah, if you get the official python download on your computer it will just come up as words with no box thatā€™s just how sololearns code playground makes you input
31st Jan 2018, 11:25 PM
Ole113
Ole113 - avatar
0
Okay, thatā€™s a shame but I can work with that. If I was going to download on my computer what version does SoloLearn use? So I know which one to get.
31st Jan 2018, 11:26 PM
Alex Herbert