+ 1
Input function in python
How to show the instruction for user to input?
10 Réponses
+ 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.
+ 5
You have no choice to change the heading in sololearn but in other software like python idle it displays the input heading.
+ 2
assume you want the program to prompt the user to enter name,the code is as follows;
name =input ("Enter name" ")
+ 2
Code syntax be
user_input=input("instructions")
Bro for your given *tags code be:
s=input("pls your name")
+ 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
+ 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
+ 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??
+ 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
+ 1
Bingo.... sorry for being a noob while trying to learn python.
+ 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)