🌐
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.
🌐
YouTube
youtube.com › watch
Python Input Output Functions | input() | print() | Python Programming for Beginners | Lecture 17 - YouTube
This video explains the following concepts :1. input() function in Python2. print() function in Python3. Typecasting User Input------------------------------...
Published: August 14, 2024
🌐
Stanford CS
cs.stanford.edu › people › nick › py › python-input.html
input()
The parameter to input() is a prompt string that prints out, prompting the user what they are supposed to type.
🌐
Towards Data Science
towardsdatascience.com › home › latest › python input, output and import
Python Input, Output and Import | Towards Data Science
January 31, 2025 - So below is the documentation of all the built-in-function available in python available in alphabetical order provided by the python.org — I call it as the cheat sheet of built-in-function, have a look below: ... Theinput()and the print() built-in-functions are one of the most commonly used functions for performing standard input and output operations.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-input-function
Python input() Function - GeeksforGeeks
The input() function in Python is used to take input from the user.
Published: September 18, 2025
🌐
LabEx
labex.io › questions › how-to-handle-user-input-in-python-132701
How to Handle User Input in Python | LabEx
July 25, 2024 - The input() function in Python is used to prompt the user for input and retrieve the data they provide.
🌐
YouTube
youtube.com › watch
How to Use the input() Function in Python - YouTube
⌨️ **How to Use the input() Function in Python** | Complete Beginner’s Guide with Practical ExamplesWelcome to this beginner-friendly Python tutorial! In thi...
Published: May 13, 2025
Find elsewhere
🌐
Python
docs.python.org › 3 › builtins › functions.html
Built-in functions — Python 3.15.0 documentation
1 day ago - More precisely, the input must conform to the complexvalue production rule in the following grammar, after parentheses and leading and trailing whitespace characters are removed: complexvalue: floatvalue | floatvalue ("j" | "J") | floatvalue sign absfloatvalue ("j" | "J") If the argument is a number, the constructor serves as a numeric conversion like int and float. For a general Python object x, complex(x) delegates to x.__complex__().
🌐
CodeHS
codehs.com › tutorial › 13255
Tutorial: User Input in Python | CodeHS
Learn how to accept user input in your Python programs.
🌐
Altcademy
altcademy.com › blog › how-to-use-input-in-python
How to use input in Python
June 13, 2023 - The input() function is a built-in Python function that allows you to accept input from the user.
🌐
GeeksforGeeks
geeksforgeeks.org › python › taking-input-in-python
Taking Input in Python - GeeksforGeeks
This is done using the input() function, which: Pauses the program and waits for the user to type something. Returns the entered value as a string (str). Optionally displays a prompt message to guide the user.
Published: May 29, 2026
🌐
Hyperskill
hyperskill.org › university › python › input-and-input-in-python
Python input() Function: Get User Input with Examples
June 5, 2026 - Through the use of the input() ... programs achieve interactivity and flexibility. The Python built in function input() lets developers gather user input while running a program....
🌐
YouTube
youtube.com › shorts › AblMyVxNUsk
Python input Function Explained with Examples | Taking Input in Python 4 Beginners #python #short - YouTube
AboutPressCopyrightContact usCreatorsAdvertiseDevelopersTermsPrivacyPolicy & SafetyHow YouTube worksTest new features · © 2026 Google LLC
Published: August 7, 2025
Views: 317
🌐
Python documentation
docs.python.org › 3 › tutorial › inputoutput.html
7. Input and output — Python 3.15.0 documentation
There are similar methods str.ljust() and str.center(). These methods do not write anything, they just return a new string. If the input string is too long, they don’t truncate it, but return it unchanged; this will mess up your column lay-out but that’s usually better than the alternative, which would be lying about a value.
🌐
TutorialsPoint
tutorialspoint.com › article › python-vulnerability-in-input-function
Python vulnerability in input() function
March 25, 2026 - Unlike Python 3.x, the Python 2.x input() function evaluates user input as Python code, while raw_input() safely returns a string.
🌐
DEV Community
dev.to › vayolapradeep › python-input-function-detailed-explanation-3898
Python input() Function - Detailed Explanation - DEV Community
February 12, 2025 - The input() function in Python is used to take user input from the keyboard. It allows your program to interact with the user by prompting them to enter data, which can then be processed or stored in variables.
🌐
Reddit
reddit.com › r/learnpython › can anyone please explain how input works in python?
r/learnpython on Reddit: Can anyone please explain how input works in python?
August 17, 2022 -

So, I wanted to make a code where a student enters his name, and then he is shown if he passed, didn’t pass but can retry or ultimately failed along with his average grade. (I don’t know how to do the along with his/her specific average grade).

And my code looks like this:

[passed = ["Bill", "Andrew", "Son", "Bella"]

Andrew_AG = ((5+2+4+4+5+5+4+5)/8)

Bill_AG = ((5+5+5+5+4+3+5+5)/8)

Son_AG = ((5+5+5+5+5+5+5+5)/8)

Bella_AG = ((5+5+5+5+4+3+5+5)/8)

re_try = ["Irina", "John", "Tommy"]

Tommy_AG = ((5+3+4+2+2+3+3+3)/8)

John= ((3+4+4+3+2+2+3+4)/8)

Irina_AG = ((2+4+4+4+2+2+3+3)/8)

failed = ["Ned", "Bet"]

Ned_AG = ((1+1+2+5+2+2+3+5)/8)

Bet_AG = ((1+2+2+3+2+2+3+1)/8)

if input ("What's your name?") == (("Bill") or ("Andrew") or ("Son") or ("Bella")): print ("You passed")

elif input ("What's your name?") == (("Irina") or ("John") or ("Tommy")): print ("You didn't pass, but you can re-try")

elif input ("What's your name?") == (("Ned") or ("Bet")): print ("You failed and you may not re-try")

else: print ("You're not on the list")

But unfortunately I’ve been running into mistakes where even if I enter the correct name it would ask me “What’s your name?” 3 times until displaying “You’re not on the list”. So I guess it’s something wrong with my understanding of Input command

(I’ve been coding only for 1 week so don’t blame me for bad code or dumb question)

Top answer
1 of 8
18
So I guess it’s something wrong with my understanding of Input command Kind of, but also no. The reason the code asks for input three times is because Each if/elif calls the function separately, and None of the conditions are true. The reason why the conditions fail is not because of input, but because you've misunderstood what the or-operator does here. The code isn't comparing the input to each of the listed cases, instead, if input ("What's your name?") == (("Bill") or ("Andrew") or ("Son") or ("Bella")): print ("You passed") is actually read by Python as if input("What's your name?") == "Bill": print ("You passed") due to short-circuiting. or is roughly equivalent to def my_or(left, right): if left: return left return right and because all non-empty strings are truthy, Python simply takes the first one and ignores the rest. So, how should you write this? My suggestion; use a tuple or a set and check inclusion with in: name = input("What's your name?") if name in {"Bill", "Andrew", "Son", "Bella"}: print("You passed") The rest of the conditions should use the already asked input, stored in name in my example.
2 of 8
4
[passed = ["Bill", "Andrew", "Son", "Bella"] That is not valid Python. The square bracket at the beginning of the line needs to be removed. That said, the problem here isn't input(), it's that your multiple conditions aren't set up correctly. This is covered in the subreddit FAQ: https://www.reddit.com/r/learnpython/wiki/faq/#wiki_variable_is_one_of_two_choices.3F Also, you should only take the name input once, save it to a variable, then check that variable against your lists of names. As your code is currently written you may get asked for a name multiple times.
🌐
YouTube
youtube.com › bro code
User input in Python is easy + exercises ⌨️ - YouTube
#user #input #python How to accept user input in Python tutorial example explained00:00:00 user input00:03:29 #1 mad libs00:07:10 #2 area calculator00:09:42 ...
Published: October 7, 2022
Views: 108K