Lecture # 8 - Accepting User Input

Accepting User Input:

Accepting user input in Python is quite straightforward. You can use the input() function to prompt the user for input.

Syntax:

input("Input Something: ")

Output:

Example:

day = input("What day is today?")
print("Today is", day)

In the above code the variable day will store the day of the week that the user enters.

Output:

0
Subscribe to my newsletter

Read articles from Abdullah Bin Altaf directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Abdullah Bin Altaf
Abdullah Bin Altaf