Input function in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Input function in python

How to show the instruction for user to input?

25th May 2020, 2:53 AM
Ivan Ong
Ivan Ong - avatar
10 Answers
+ 6
Ivan, your profile indicates you have completed almost half of the Python course. Is there a particular issue that is not explained in the lessons? Please clarify your question so we can help.
25th May 2020, 3:05 AM
David Ashton
David Ashton - avatar
+ 5
You have no choice to change the heading in sololearn but in other software like python idle it displays the input heading.
26th May 2020, 11:46 AM
Tanmay Gupta
Tanmay Gupta - avatar
+ 2
assume you want the program to prompt the user to enter name,the code is as follows; name =input ("Enter name" ")
26th May 2020, 12:26 PM
Paul Ndambo Ngila
Paul Ndambo Ngila - avatar
+ 2
Code syntax be user_input=input("instructions") Bro for your given *tags code be: s=input("pls your name")
26th May 2020, 2:45 PM
DEEPAK KUMAR
DEEPAK KUMAR - avatar
+ 1
In the course, it just show a pop up n the instructions i put is part of the variable. Meaning when i print(s), it will show Pls name Ivan instead of just Ivan
25th May 2020, 3:08 AM
Ivan Ong
Ivan Ong - avatar
+ 1
I hope this is what you are looking for. I don't understand what you are looking to do. https://code.sololearn.com/csYr5MjH304a/?ref=app
25th May 2020, 3:26 AM
Josshual A. Toro M.
Josshual A. Toro M. - avatar
+ 1
The pop up windows doesnt show the instruction i want to show. "Pls Name" Otherwise, how user will know what to key? Any better idea to do it??
25th May 2020, 3:29 AM
Ivan Ong
Ivan Ong - avatar
+ 1
If you mean when you execute the code for example name = input ("Your name") Your name is not shown, it is because the SoloLearn CodePlayground works that way. If you need multiple entries for example: age = input ("Your age") You need to put in the entrance: Ivan -> press enter 30 - -> Run
25th May 2020, 4:06 AM
Josshual A. Toro M.
Josshual A. Toro M. - avatar
+ 1
Bingo.... sorry for being a noob while trying to learn python.
25th May 2020, 12:14 PM
Ivan Ong
Ivan Ong - avatar
+ 1
Input() returns the entered value as a string. If you want to take input a number and want to perform mathematical operation, you will have to use typecasting also. input_var = input("Enter your name : ") print("\nName is : " + input_var) num = int(input("Enter integer and get its twice : ")) print("\nOutput is : ", num*num)
26th May 2020, 11:46 AM
Ajay Kumar Maurya
Ajay Kumar Maurya - avatar