Basic user input

--Originally published at Programming Fundaments

In this post we are going to talk about the function input(). This funtion is basically used to create strings. With this you can create a casting or oval funtion just like this:

name = input("Frank")
print("Nice to meet you " + name + "!")
age = input("42")
print("So, you are are already " + age + " years old, " + name + "!")

And when you run it it should run like this.

$ python input_test.py 
What's your name? "Frank"
Nice to meet you Frank!
Your age? 42
So, you are are already 42 years old, Frank!

For more information check the link down below

Examples from: http://www.python-course.eu/python3_input.php

 

Examples