$type=grid$count=4$tbg=rainbow$meta=0$snip=0$rm=0$show=home

Python Input Function

Python is really cool and fun to play around. Lets write a simple program to ask user enter their name and age. To do this here, we'...

Python is really cool and fun to play around. Lets write a simple program to ask user enter their name and age. To do this here, we're going to use python input function

CODE
name input("What is your name?: ")
print(name)
age input "How old are you?: " )
print(age
OUTPUT
name input("What is your name?: ")
What is your name?: Xayah
print(name)
Xayah

age input "How old are you?: " )
How old are you?:19
print(age)
19 
Now, lets make it more interesting by telling python to display the name and the age of the user in one line.

CODE
name input("What is your name?: ")
print(name)
age input("Enter your age: ")
print(name"is"age"years old.")
OUPUT
name input("What is your name?: ")
What is your name?: Xayah
print(name)
Xayah

age input("How old are you?: ")
How old are you?:19
19
print(name"is"age"years old.")
Xayah is 19 years old.  

COMMENTS

Name

css,17,html,7,php,2,python,1,tech,18,
ltr
item
iWriteLess Tech Blog: Python Input Function
Python Input Function
https://1.bp.blogspot.com/-Bfir6X_jfaI/WmcDC0EI5ZI/AAAAAAAABmA/z5IdclC1ZMYoGCtskDOe4rVe5nTZXT0aACLcBGAs/s1600/python_input.jpg
https://1.bp.blogspot.com/-Bfir6X_jfaI/WmcDC0EI5ZI/AAAAAAAABmA/z5IdclC1ZMYoGCtskDOe4rVe5nTZXT0aACLcBGAs/s72-c/python_input.jpg
iWriteLess Tech Blog
http://www.iwriteless.com/2017/12/python-input-function.html
http://www.iwriteless.com/
http://www.iwriteless.com/
http://www.iwriteless.com/2017/12/python-input-function.html
true
2724151228810149585
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy