integer_number = int(input("something here"))

is just an abbreviated way of saying:

temp_var = input("something here")
integer_number = int(temp_var)

It is not the other way around, because the int() function takes a string and converts it into an int. If you did it the other way around, the function wouldn't have anything to convert.

Answer from ByteDev on Stack Overflow
Top answer
1 of 5
7
integer_number = int(input("something here"))

is just an abbreviated way of saying:

temp_var = input("something here")
integer_number = int(temp_var)

It is not the other way around, because the int() function takes a string and converts it into an int. If you did it the other way around, the function wouldn't have anything to convert.

2 of 5
2

In Python you can pass functions as arguments of another function and of course they'll be evaluated before the outer function. Guess I should point you to the relevant official Python documentation that states that, but just googling for it isn't working right now.

See Python’s Functions Are First-Class:

Python's functions are first-class objects. You can assign them to variables, store them in data structures, pass them as arguments to other functions, and even return them as values from other functions.

Got a nice answer about that on SO :

What are "first-class" objects:

In short, it means there are no restrictions on the object's use. It's the same as any other object.

A first class object is an entity that can be dynamically created, destroyed, passed to a function, returned as a value, and have all the rights as other variables in the programming language have.

Your one is not the first question about that:

All arguments are evaluated before the function is called:

Answer:

You are right, all arguments are evaluated before the function is called, otherwise the function cannot know what is passed to it. So what you are doing is actually:

but no link to docs here too.

Took a while, I found it here:

6.3.4. Calls its the link for Python 3:

...............All argument expressions are evaluated before the call is attempted. Please refer to section Function definitions for the syntax of formal parameter lists.........

🌐
W3Schools
w3schools.com › PYTHON › python_user_input.asp
Python User Input
The input from the user is treated as a string. Even if, in the example above, you can input a number, the Python interpreter will still treat it as a string.
🌐
Hyperskill
hyperskill.org › university › python › input-and-input-in-python
Python input() Function: Get User Input with Examples
June 5, 2026 - This line of code will change the users input, into an integer. Store it in the variable age. The function input() is a feature already included in Python that lets you receive input from users.
🌐
Python.org
discuss.python.org › python help
I'm new to python: convention question - Python Help - Discussions on Python.org
July 14, 2023 - I’m new to python. I wanted to know if when I use the input command, is it common to write the type of variable we expect to recieve from the input? For example: num = int(input()) The other option: just num=input() …
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-take-integer-input-in-python
How to take integer input in Python? - GeeksforGeeks
April 3, 2026 - In Python, the built-in input() function always returns a string. To take integer input, the string must be typecast into an integer using the int() function.
🌐
Stanford CS
cs.stanford.edu › people › nick › py › python-input.html
input()
>>> age = input('what is your age? ') what is your age? 25 >>> age '25' >>> int(age) 25
Find elsewhere
🌐
Real Python
realpython.com › python-input-integer
How to Read Python Input as Integers – Real Python
March 18, 2026 - The input() function can return arbitrary text, or even an empty string if the user pressed Enter immediately at the prompt. How can you ensure that your program doesn’t attempt to perform arithmetic with a mess of characters when it’s expecting an int? You’re going to leverage Python’s own error-handling mechanism.
🌐
GeeksforGeeks
geeksforgeeks.org › python › taking-input-in-python
Taking Input in Python - GeeksforGeeks
Unlike some languages that rely on dialog boxes, Python keeps it simple by taking input directly from the console. This program asks the user for a value, stores it as a string and then prints it back. ... You can optionally provide a prompt message (e.g., "Enter your age:"). Whether you type letters, numbers, or symbols, Python always stores it as a string by default. If you need another data type (like integer or float), you must convert it manually using typecasting.
Published: May 29, 2026
🌐
Replit
replit.com › home › discover › how to take integer input in python
How to take integer input in Python | Replit
April 14, 2026 - Learn how to take integer input in Python. This guide covers methods, tips, real-world uses, and common error debugging.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-receive-user-input-python
How to Receive User Input in Python: A Beginner’s Guide | DigitalOcean
Learn how to receive user input in Python using the input() function, command-line arguments, and GUI methods. Explore examples, best practices, and common m…
🌐
SciPy
docs.scipy.org › doc › scipy › reference › generated › scipy.stats.f_oneway.html
f_oneway — SciPy v1.18.0 Manual
If an int, the axis of the input along which to compute the statistic. The statistic of each axis-slice (e.g. row) of the input will appear in a corresponding element of the output.
🌐
Facebook
facebook.com › LearnRealPython › posts › -in-this-tutorial-youll-learn-how-to-use-python-to-get-integer-input-from-the-us › 569147122100342
🐍📰 In this tutorial, you'll learn how to use Python to get ...
Real Python. 160,787 followers · 990 talking about this. Online Python Training & Expert Community: Tutorials, Video Courses, Books, Quizzes...and More! Join 3,000,000 Monthly Readers at realpython.com
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-int-function
Python int() Function - GeeksforGeeks
September 26, 2025 - In this example, we passed a string, a float, and an integer value as a parameter to the int() function in Python to see how the input is affected by applying the int() function.
🌐
Flet
flet.dev › introduction
Introduction | Flet
Flet is a Python framework for building web, desktop, and mobile apps without prior experience in frontend development. Use ready-made controls to create your interface, connect your Python libraries and application logic, and handle user interactions without writing HTML, CSS, or JavaScript.
🌐
Python
docs.python.org › 3 › library › math.html
math — Mathematical functions
Calculate the product of all the elements in the input iterable. The default start value for the product is 1. When the iterable is empty, return the start value. This function is intended specifically for use with numeric values and may reject non-numeric types.
🌐
EE-Vibes
eevibes.com › computing › how-to-take-integer-input-in-python
How to take integer input in Python?
December 6, 2021 - There is contrast by they way you can take input in python 2.x and 3.x. You want to utilize raw_input in python 2.x and contribution to Python 3.x In Python 3.x, raw_input was renamed to include and the Python 2.x information was taken out. As you would know, raw_input consistently returns a String article and same is the situation with input in Python 3.x To fix the issue, you want to unequivocally make those contributions to numbers by placing them in int() work.
🌐
Automate the Boring Stuff
automatetheboringstuff.com › 3e › chapter1.html
Chapter 1 - Python Basics, Automate the Boring Stuff with Python, 3rd Ed
The * operator can only be used with two numeric values (for multiplication), or one string value and one integer value (for string replication). Otherwise, Python will just display an error message, such as the following: >>> 'Alice' * 'Bob' Traceback (most recent call last): File "<python-input-0>", line 1, in <module> 'Alice' * 'Bob' TypeError: can't multiply sequence by non-int of type 'str' >>> 'Alice' * 5.0 Traceback (most recent call last): File "<python-input-0>", line 1, in <module> 'Alice' * 5.0 TypeError: can't multiply sequence by non-int of type 'float'
🌐
W3Schools
w3schools.com › python › ref_func_input.asp
Python input() Function
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 ... The input() function allows user input.