Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python print user input

name = input("Hi! What’s your name ? ")
print("Nice to meet you " + name + "!")

age = input("How old are you ? ")

print("So, you are already " + str(age) + " years old, " + name + " !")
Comment

python how to print input

#To print user input, take the input from the user and store it as a variable. For example I named the variable "name" because that is the question the user will answer.
name = input("What is your name?")
#Then enter in a print command to actually print the user input. Change the "name" variable to the variable you named it.
print("Nice to meet you," + name)
#Feel free to copy and paste the code and edit it to your liking. Hope this helped!
Comment

print input in python

# Take input from user and store it as a variable. E.g. I store the input as 'user_inp'
user_inp = input("Enter anything you want: ")

#Now you can print it by using print function
print("You entered ", user_inp)
# If you don't want "You entered " you can simply write as:- print(user_inp)
Comment

PREVIOUS NEXT
Code Example
Python :: pyplot rectangle over image 
Python :: print all unique values in a dictionary 
Python :: python how to replace a certain string in text 
Python :: generate unique id from given string python 
Python :: print statement in python 
Python :: creating a pandas df 
Python :: copy website python 
Python :: pandas index between time 
Python :: plotly vertical bar chart 
Python :: python float to decimal 
Python :: python count code, Count number of occurrences of a given substring 
Python :: how to get key of a particular value in dictionary python using index 
Python :: load json py 
Python :: python parallel processing for loop 
Python :: make white image numpy 
Python :: count item in list python 
Python :: numpy find columns containing nan 
Python :: Date Time split in python 
Python :: how to iterate over columns of pandas dataframe 
Python :: check python version 
Python :: vscode pylint missing module docstring 
Python :: pandas sort dataframe by column 
Python :: python add one 
Python :: python switch case 3.10 
Python :: pandas string manipulation on column 
Python :: python pyowm 
Python :: django python base 64 decode 
Python :: levenshtein distance 
Python :: plotly graph object colorscale 
Python :: python find largest variable 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =