1. Introduction

1. User Input

Python allows for user input. That means we are able to ask the user for input.

The following example asks for your name, and when you enter a name, it gets printed on the screen.

Example: Ask for user input

print("Enter your name:")
name = input()
print(f"Hello {name}")

Sample run:

Enter your name:
Ada
Hello Ada

Python stops executing when it comes to the input() function, and continues when the user has given some input.