+ 2
How to use input comand in python
6 Respuestas
+ 6
Try to perform a little search before asking, you'll find the answer much more quickly and it's an important programming skill to be able to look up information.
https://sololearn.com/compiler-playground/W3uiji9X28C1/?ref=app
https://sololearn.com/compiler-playground/W0uW3Wks8UBk/?ref=app
+ 4
Adarsh Singh ,
> your profile shows that you already have started with the tutorial `introduction to python`.
we can not see how far you have proceeded upto now. but it looks like you need to get a bit more familiar with the basics of python.
> so please re-read the required lessons and proceed learning. the print() statement and other required topic of python are explained there.
+ 3
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/ref_func_input.asp
just google it up before asking, it saves you lots of time
+ 2
input()
To get an input and
x = input()
To store the result, with x being whatever variable name you need.
An example could look like this
name = input()
print(name)
This would display whatever the user inputted.
I believe int(input()) is for integer only inputs but id have to test that.
Thats a pretty basic summary of inputs
+ 1
# Hi Sam!
# In these cases the input() value comes from the user ( or from the sololearn excercise program), no need to hardcode it.
# Try with something like this:
# 1., give a name to the variable:
# Here you give a NAME (person1 and person2)
# to the variables, and the input is waiting
# for the user to type
# variable NAME = variable VALUE
person1 = input() # user input VALUE
person2 = "Tom" # hardcoded value
# 2., Here you give an order to the program to
# display the input what the user typed.
# In the 2nd line the program will display
# the word: Tom
#
# you can call the values by their name.
# The program will display the value what
# the user typed.
print(person1)
print(person2)
0
Am having issues passing this task
# Ask the user for input and store it in a variable
name= input("Tom")
name= input("Bob")
# Display the user input on the screen
print("Tom's input :", Tom)
print("Bob's input :", Bob)