No, input is not a keyword. Instead, it is a built-in function.

And yes, you can create a variable with the name input. But please don't. Doing so is a bad practice because it overshadows the built-in (makes it unusable in the current scope).

If you must use the name input, the convention is to place an underscore after it:

input_ = input()
Answer from user2555451 on Stack Overflow
Top answer
1 of 2
62

No, input is not a keyword. Instead, it is a built-in function.

And yes, you can create a variable with the name input. But please don't. Doing so is a bad practice because it overshadows the built-in (makes it unusable in the current scope).

If you must use the name input, the convention is to place an underscore after it:

input_ = input()
2 of 2
2

input is not a keyword, it's a function provided by the standard library and included in the builtins module (this module provides globally accessible variables and functions.):

>>> import builtins
>>> input is builtins.input
True

And sure, you can create a variable with the name input. It's perfectly fine for experienced and intermediate users to do so because they can easily figure that the input name has been re-used.

Use the best name for the content/intent you want to convey. If input is the best then use it (provided you don't need the builtin), and don't confuse readers with names like input_ (beginners will wonder whether there's a special meaning to a trailing underscore)

But if you're a beginner please don't re-define builtins, by overshadowing the built-in input (overshadowing a variable makes it unusable in the current scope) you'll end-up with this error when calling input() later on (in the same scope) and you may struggle to figure out why:

TypeError: 'str' object is not callable

Beginners should instead use another name, preferably not input_ because underscores have special meanings in python, as a result other beginners will wonder whether there's a special meaning for that trailing underscore (is it the same or related to leading underscores? or maybe to double underscores?)

In another comment someone stated that it is a bad practice to overshadow variables and he even came up with a convention that he borrowed from another use. After all, if overshadowing variables were a really bad practice, the python language designers wouldn't have allowed it in the first place, but they know and recognize that it has the potential to improve readability, just as it does in other languages. So they allowed it, and it also ease transition to Python from other languages where overshadowing is also allowed like C/C++, Java and even bash.

note: the conventional use for a trailing underscore is where it's impossible to use a name, like the keyword class in Python. Then you'd use class_ (but like I wrote above, it's best to avoid it in Python because underscores can confuse beginners as they can convey special meanings)

🌐
GeeksforGeeks
geeksforgeeks.org › python › python-interview-questions
Top 50+ Python Interview Questions and Answers (2025) - GeeksforGeeks
July 11, 2026 - Starting with Python 3.10, however, Python introduced structural pattern matching using the match and case keywords, which provides similar functionality. ... value = 2 match value: case 1: result = "one" case 2: result = "two" case 3: result = "three" case _: result = "unknown" print(result) ... To do well in interviews, you need to understand core syntax, memory management, functions, recursion, data structures and practical coding problems.
🌐
Fullstackadda
fullstackadda.com › python-interview-questions
Python Interview Questions - Fullstackadda
February 9, 2023 - Here is a list of possible interview questions of Python, along with answers to help you prepare for your interview: Python is a general-purpose programming language that is widely used for web development, scientific computing, data analysis, artificial intelligence, and many other areas. ... Variables are created by assigning a value to a name using the assignment operator (=). A list is mutable (can be changed), while a tuple is immutable (cannot be changed). Functions are created using the “def” keyword, followed by the function name and parentheses.
🌐
Fonzi AI
fonzi.ai › blog › python-interview-questions
50+ Common Python Interview Questions and Answers for 2025 - Fonzi AI Recruiter
September 25, 2025 - Functions and methods are fundamental ... functions include: Functions are defined using the def keyword. Functions can accept parameters to receive input data....
🌐
GeeksforGeeks
geeksforgeeks.org › python › taking-input-in-python
Taking Input in Python - GeeksforGeeks
Whether you type letters, numbers, or symbols, Python always stores it as a string by default.
Published: May 29, 2026
🌐
Reddit
reddit.com › r/python › 5 years coding in python, 4 professionally as a data engineer, i just discovered the "input" keyword and its purpose
r/Python on Reddit: 5 years coding in python, 4 professionally as a data engineer, I just discovered the "input" keyword and its purpose
February 21, 2022 -

Edit : input is a builtin and not a keyword

This morning, I was as usual working on a python app, when I wrote 'input' unquoted to get a field in a dict. That's the moment my syntax coloring marked it as a keyword.
My first reaction was "bleh, I need to correct the dam syntax in vim" before actually looking for it. That's pretty neat to be able to input data in the console. I'm feeling like a complete newbie.

My program :

x =input() ; print('Bonjour',x)
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-input-function
Python input() Function - GeeksforGeeks
Python Tutorial · Data Types · ... · Django · Flask · Last Updated : 18 Sep, 2025 · The input() function in Python is used to take input from the user....
Published: September 18, 2025
🌐
W3Resource
w3resource.com › python-interview › python-variables-and-data-types.php
Python interview questions and answers: Syntax and data types
What is the best way to check whether a string contains a specific substring in Python? Check for substrings in a string using different approaches. ... Describe the significance of Boolean values (True and False) in control flow. How to convert a string containing a numerical value to an actual number? Illustrate the process of converting a string to an int or float data type. How do you handle user input in Python, and what data type is the input?
🌐
W3Schools
w3schools.com › python › python_interview_questions.asp
Python Interview Questions
This page contains a list of typical Python Interview Questions and Answers.
🌐
Simplilearn
simplilearn.com › home › resources › software development › top 100+ python interview questions and answers
Top 100+ Python Interview Questions and Answers
August 1, 2026 - Prepare for Python interviews! Explore 100+ must-know Python interview questions with answers for freshers, intermediate, and experienced developers.
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
InterviewBit
interviewbit.com › python-interview-questions › amp
Top Python Interview Questions and Answers (2025) - InterviewBit
Self is used to represent the instance of the class. With this keyword, you can access the attributes and methods of the class in python. It binds the attributes with the given arguments. self is used in different places and often thought to be a keyword.
🌐
NxtWave
ccbp.in › blog › articles › python-interview-questions
Python Interview Questions: Ultimate Guide with Answers
Python variables, keywords, and identifiers are often tested in python basic interview questions for freshers.
🌐
Tutorialspoint
tutorialspoint.com › python › python_interview_questions
Python Interview Questions and Answers
Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.
🌐
Digital Journal
digitaljournal.com › pr › news › binary-news-network › python-interview-questions-essential-questions-1112556258.html
Python Interview Questions: Essential Questions to Help You Prepare
September 17, 2024 - Functions in Python are blocks of reusable code that perform a specific task. They help in reducing redundancy and improving code organization. Functions are defined using the def keyword.
🌐
Udacity
udacity.com › blog › top-python-interview-questions-for-your-next-job-opportunity
Python Interview Questions and Answers (2026): 50+ Q&A Guide | Udacity
July 17, 2026 - Without these keywords, Python treats assignments inside a function as creating new local variables. Common mistake: Forgetting that assignment inside a function creates a local variable by default, even if a global variable with the same name exists. This causes UnboundLocalError more often than most beginners expect. What interviewers are testing: Whether you handle errors deliberately rather than catching everything blindly.
🌐
W3Schools
w3schools.com › python › ref_func_input.asp
Python input() Function
Python Overview Python Built-in Functions Python String Methods Python List Methods Python Dictionary Methods Python Tuple Methods Python Set Methods Python File Methods Python Keywords Python Exceptions Python Glossary · Built-in Modules Random Module Requests Module Statistics Module Math Module cMath Module · Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Training
🌐
DataCamp
datacamp.com › blog › top-python-interview-questions-and-answers
The 41 Top Python Interview Questions & Answers For 2026 | DataCamp
April 30, 2026 - Take the essential practicing coding interview questions course to prepare for your next coding interviews in Python. You are provided with a large string and a dictionary of the words. You have to find if the input string can be segmented into words using the dictionary or not.
🌐
Curotec
curotec.com › home › 125 python interview questions
125 Python Interview Questions in 2026
July 24, 2025 - An anonymous function defined with the lambda keyword. Example: lambda x: x + 1. Dynamically typed – types are determined at runtime. Type hints specify expected variable types using annotations, improving code readability.
🌐
CodeSignal
codesignal.com › home › blog › interview prep › key python interview questions (and answers) from basic to senior level
Key Python Interview Questions From Basic To Senior Level
February 28, 2025 - Many coding questions tend to build off the basics, and knowing some common patterns will make approaching new problems easier. Master built-in Python features: Become adept at using built-in Python data structures and methods. Understand methods for lists, dictionaries, sets, strings, etc., and know when to apply them. Handle input/output: Review input/output operations in Python, including reading input, opening files, and writing output.