In your example you probably typed just one number on the line, and the error was raised because you expect 2 (a and b)

You should type both numbers on the same line, then enter.

You can change your code to accept any number of numbers, and store them in a list:

res = input("Enter your numbers:").split()
print(*res)   ## prints the list content
for r in res: ## prints number one by one and one per line
    print(r)

result:

Enter your numbers: 12 13 14
12 13 14
12
13
14
Answer from Malo on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › taking-multiple-inputs-from-user-in-python
Taking multiple inputs from user in Python - GeeksforGeeks
June 26, 2026 - One of the simplest ways to take multiple inputs from a user in Python is by using the input() function along with the split() method.
🌐
CodeChef
codechef.com › learn › course › python › LTCPY10 › problems › PYTHCL50C
Multiple string inputs in Python Programming
Test your Learn Python Programming knowledge with our Multiple string inputs practice problem. Dive into the world of python challenges at CodeChef.
🌐
W3Schools
w3schools.com › python › ref_string_split.asp
Python String split() Method
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 split() method splits a string into a list.
🌐
YouTube
youtube.com › watch
Input a List using split() Method in Python - YouTube
Python Programming: Input a List using split() Method in PythonTopics discussed:1. Rivising the split() Method.2. Input a List using the split() Method. Pyth...
Published: August 1, 2023
🌐
Hyperskill
hyperskill.org › university › python › split-in-python
Python split(): Split Strings by Delimiter with Examples
June 5, 2026 - To use the split() function, provide the delimiter as an argument within the parentheses. The delimiter can be any character or substring that you want to use as a separator. The function searches for occurrences of the delimiter within the string and breaks it down at each occurrence. # Using whitespace as a delimiter text = "Hello World! Welcome to Python!" result = text.split() print(result) # Output: ['Hello', 'World!', 'Welcome', 'to', 'Python!'] # Using a comma as a delimiter fruits = "apple,banana,orange" result = fruits.split(",") print(result) # Output: ['apple', 'banana', 'orange']
Find elsewhere
🌐
Medium
geekpython.medium.com › take-multiple-inputs-from-users-in-one-line-using-python-7c7594237f5a
Take Multiple Inputs From Users In One Line Using Python | by Sachin Pal | Medium
December 11, 2022 - Well, we learned how to take multiple inputs from users in a single line of Python code instead of writing multiple lines of code. We used the split() method which is primarily used for splitting the Python string into a list and then we used the list comprehension technique which offers a shorter syntax to define and create a list in Python.
🌐
Mimo
mimo.org › glossary › python › string-split-method
Learn Python's String Split Method, Simplify Text Processing
To split a string into a list of substrings, you use the built-in string method .split(). Its behavior depends on the arguments you provide. ... Become a Python developer.
🌐
DEV Community
dev.to › mohit355 › 3-5-split-method-in-python-2e19
3.5 split() method in Python - DEV Community
December 19, 2019 - It breaks the given input by the specified separator. If separator is not provided then any white space is a separator. Generally, user use a split() method to split a Python string but one can used it in taking multiple input.
🌐
GitHub
github.com › zhiwehu › Python-programming-exercises › blob › master › 100+ Python challenging programming exercises for Python 3.md
Python-programming-exercises/100+ Python challenging programming exercises for Python 3.md at master · zhiwehu/Python-programming-exercises
Suppose the following input is supplied to the program: New to Python or choosing between Python 2 and Python 3? Read Python 2 or Python 3. Then, the output should be: 2:2 3.:1 3?:1 New:1 Python:5 Read:1 and:1 between:1 choosing:1 or:2 to:1 · Hints In case of input data being supplied to the question, it should be assumed to be a console input. ... freq = {} # frequency of words in text line = input() for word in line.split(): freq[word] = freq.get(word,0)+1 words = freq.keys() words.sort() for w in words: print("%s:%d" % (w,freq[w]))
🌐
OpenAI Help Center
help.openai.com › en › articles › 4936856-what-are-tokens-and-how-to-count-them
Understanding and counting tokens | OpenAI Help Center
August 29, 2026 - A plain-text token count does not necessarily include all tokens in an API request. Message structure, tools, schemas, images, and files can affect the full input count.
🌐
Upgrad
upgrad.com › home › blog › data science › python split() function: syntax, parameters, examples
Python Split() Function: Examples, Methods & Practical Tips
July 6, 2026 - This collection is what Python calls a ... function is the go-to method for parsing data. If you have data separated by commas, tabs, or any other character, the split() method is how you separate those values for individual processing.
🌐
Google AI
discuss.ai.google.dev › google antigravity › [bug & fix provided] terminal deadlocks on linux using fish
[Bug & Fix Provided] Terminal deadlocks on linux using fish - Google Antigravity - Google AI Developers Forum
April 7, 2026 - Due to a combo of fish and vscode shell integration scripts for fish, any terminal where antigravity has “injected” a cd when the llm passes a differend cwd param, will cause a complete deadlock of the pty instance. The…
🌐
Jinja
jinja.palletsprojects.com › en › stable › templates
Template Designer Documentation — Jinja Documentation (3.1.x)
A template contains variables and/or expressions, which get replaced with values when a template is rendered; and tags, which control the logic of the template. The template syntax is heavily inspired by Django and Python.
🌐
Python
docs.python.org › 3 › library › os.path.html
os.path — Common pathname manipulations
Return the base name of pathname path. This is the second element of the pair returned by passing path to the function split().
🌐
GeeksforGeeks
geeksforgeeks.org › python › input-and-output-in-python
Input and Output in Python - GeeksforGeeks
x, y = input("Enter two numbers: ").split() print(x , y) Output · Enter two numbers: 10 20 10 20 · We can change the user input from default string type to any other type (int, float, etc) by typecasting. Python · i = int(input("How old are you?: ")) f = float(input("Evaluate 7/2: ")) print(i, f) Output ·
Published: September 19, 2026
🌐
Plain English
plainenglish.io › home › blog › python › how to take multiple inputs from users in python
How to Take Multiple Inputs From Users In Python
July 11, 2021 - x = [int(x) for x in ... 11, 1, 2, 3, 4] strip() is an inbuilt function in the Python programming language that returns a copy of the string with both leading and trailing characters removed (based on the string ...