Answers for "text input python"

9

input in python

name = input("What is your name?n") # Asks the user 'What is your name?' and stores it in the 'name' variable

print("You said your name was " + name)

number = int(input("Please select a random number:n")) # Will get input as a number
# Will error if the value entered is not a number

# You can use any type of conversion (int(), bool(), float(), etc.) to modify your input
Posted by: Guest on October-21-2020
10

python how to use input

#basic user handling for begginers

x = input("your question here") # when someone types something here that answer will be saved and be used for later

# for example 
print(x)
Posted by: Guest on March-25-2020
1

how to use input in python

#The input command will popup/print the text placed inside the brackets.
#After the text you can type anything and press enter.
#Then the stuff written in the ansfer field will be saved as the function value.

x = input("write anything after this: ")
print(x)

#This code will first print the stuff written in input (write anything after this:).
#Then it will store the text as the x value.
#Then it will print it.
Posted by: Guest on May-07-2021
1

input in python

age = input("Your age: ")
print("Your age is: " + age)

# defines input as a string and prints it out
Posted by: Guest on October-05-2020

Python Answers by Framework

Browse Popular Code Answers by Language