Taking two different user inputs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Taking two different user inputs

https://code.sololearn.com/cAVmwbUaKJ4C/?ref=app I am trying to get two different user inputs for two different variables but it seems to only work if I leave only one input in the code. As a beginner, I also would like some feedback on code in general, what could be done better ?

5th May 2020, 10:40 PM
Ayo Go
Ayo Go - avatar
2 Answers
+ 2
Works fine I entered Abhay b Output was b occured 1 time
5th May 2020, 10:43 PM
Abhay
Abhay - avatar
+ 1
A thing i like to do to cut down on code is to put the message in the input like so: choice = input('What'\s it gunna be? > ') Now when your program gets to 'choice = ...' the message inside input will be shown as the prompt. just type value and hit enter it will be mapped to the variable you assigned. In my case, the input was assigned to 'choice'. Its fine the way it is, but i figure you could save time in the future this way.
5th May 2020, 11:25 PM
Slick
Slick - avatar