xxxxxxxxxx
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 + " !")
xxxxxxxxxx
# Take user input in python
age = int(input("Type the age: "))
if age <= 18:
print("You are too young to enter here")
xxxxxxxxxx
string = input("Enter a string: ")
number = int(input("Enter a number: "))
xxxxxxxxxx
Use the input() method
Example
#code
name = input("Name Please: ")
print(f'Hello {name}, what can I do for you?')
#console
Name Please:
>>> Steve
Hello Steve, what can I do for you?