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)

🌐
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)
Discussions

5 years coding in python, 4 professionally as a data engineer, I just discovered the "input" keyword and its purpose
Hate to pedantic you like this, but input isn’t a keyword , it’s a builtin function . More on reddit.com
🌐 r/Python
15
0
February 21, 2022
How to skip to a line in Python 3
I believe what you'll want is something like while x != a: More on reddit.com
🌐 r/learnprogramming
16
2
July 20, 2021
Best way to search youtube using keyword input for a discord bot ?
sometimes it gives me a completely different video than what i searched for Do you have an example search that does this? Do you get the same results searching youtube "manually" in your browser with the same terms? More on reddit.com
🌐 r/learnpython
4
1
November 3, 2020
Positional-only arguments in Python
Wow! The count for features I will never use in 3.8 is now up to 2! More on reddit.com
🌐 r/Python
116
386
August 26, 2019
🌐
W3Schools
w3schools.com › python › ref_func_input.asp
Python input() Function
Python Overview Python Built-in ... Python Syllabus Python Study Plan Python Interview Q&A Python Training ... The input() function allows user input....
🌐
GeeksforGeeks
geeksforgeeks.org › python › input-and-output-in-python
Input and Output in Python - GeeksforGeeks
The print() function is used for output in various formats and the input() function enables interaction with users. Python's input() function is used to take user input.
Published: 3 weeks ago
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-input-function
Python input() Function - GeeksforGeeks
The input() function in Python is used to take input from the user. It waits for the user to type something on keyboard and once user presses Enter, it returns the value.
Published: September 18, 2025
🌐
Real Python
realpython.com › python-input-output
Basic Input and Output in Python – Real Python
July 3, 2026 - In this tutorial, you'll learn how to take user input from the keyboard with the input() function and display output to the console with the print() function. You'll also use readline to improve the user experience when collecting input and ...
🌐
GeeksforGeeks
geeksforgeeks.org › taking-input-in-python
Taking input in Python - GeeksforGeeks
Understanding input and output ... can display output in various formats, while the input() function enables interaction with users by gathering input during program execution....
Published: January 2, 2025
Find elsewhere
🌐
Stanford CS
cs.stanford.edu › people › nick › py › python-input.html
input()
The print() function makes it easy to send your data as text to standard out (see also: print()). The Python function input() goes the other direction, letting the user type something that goes in a Python variable. Here is an example of input() in the interpreter to see how it works:
🌐
Codingal
codingal.com › coding-for-kids › blog › what-is-input-in-python
What is input in Python | Codingal
November 24, 2025 - The raw_input() method is used by Python’s older versions, whereas the input() method is used by Python’s most recent version. For interactive applications to be built, user input is essential.
🌐
Nanyang Technological University
libguides.ntu.edu.sg › python › input
1.7 Input function - Python for Basic Data Analysis - LibGuides at Nanyang Technological University
August 26, 2026 - Programs usually request for some user input to serve its function (e.g. calculators asking for what numbers to use, to add/subtract etc.). In Python, we request user input using the input() function. Syntax · message = input("This is where you type in your input request: ")
🌐
HackerEarth
hackerearth.com › practice › python › getting started › input and output
Input and Output Tutorials & Notes | Python | HackerEarth
You can always tell your user what to input by printing a prompt. There is no difference between input in Python 3 and raw_input in Python 2 except for the keywords.
🌐
Programiz
programiz.com › python-programming › keyword-list
List of Keywords in Python Programming
Here, the function checks the input number and prints the result if it is 1 or 2. Any input other than this will cause the else part of the code to execute. Learn more about Python if and if...else Statement.
🌐
Tech with Tim
techwithtim.net › tutorials › python-programming › beginner-python-tutorials › basic-operators-input
Python Tutorial - Getting Input From Users
However, we want the user to be able to talk back to us and give us information. This is known as input! To get input from the user we can use the keyword "input". This will allow for the user to input some text and hit the enter key when they ...
🌐
W3Schools
w3schools.com › python › python_ref_keywords.asp
Python Keywords
Python has a set of keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers.
🌐
DEV Community
dev.to › vayolapradeep › python-input-function-detailed-explanation-3898
Python input() Function - Detailed Explanation - DEV Community
February 12, 2025 - What is the input()Function? The input() function in Python is used to take user input... Tagged with webdev, beginners, python, tutorial.
🌐
AskPython
askpython.com › python › examples › python-user-input
Python User Input from Keyboard - input() function - AskPython
April 23, 2026 - Python user input from keyboard can be read using the input() method. The user input is always read as string. Python 2 raw_input() method, python 3 input().
🌐
learnpython4cbse
learnpython4cbse.com › python › 4.-python:-input-(-)-and-print-(-)-function
4. Python: input ( ) and print ( ) function
The user may enter a number or a string but the input() function treats them as strings only. ... Here, • The prompt is an optional parameter and where prompt is the string you wish to display on the screen. ... When we execute the above program, the program doesn’t add the two numbers together; it just puts one right after the other as 1020 ... Python offers two functions int...
🌐
Real Python
realpython.com › python-keywords
Python Keywords: An Introduction – Real Python
May 22, 2026 - The file I/O context manager provided ... the with keyword opens the file for reading, assigns the open file pointer to input_file, then executes whatever code you specify in the with block. Then, after the block is executed, the file pointer closes. Even if your code in the with block raises an exception, the file pointer would still close. For a great example of using with and context managers, check out Python Timer Functions: ...
🌐
Programiz
programiz.com › python-programming › methods › built-in › input
Python input()
The input() function takes input from the user and returns it. In this tutorial, we will learn about the Python input() function with the help of examples.