Python Error – TypeError: input expected at most 1 arguments, got 3
Python Error – TypeError: input expected at most 1 arguments, got 3
You got that error because you in fact gave 3 arguments to the input
function when it was only expecting 1 (namely, a string prompt).
In input (What was your favorite part of the book,, your_name, ?)
---------------------------------------- , ---------, ---
The underlined parts are the comma-separated arguments: a string (What is ….book, a variable your_name
, and another string, ?
I think what you wanted was
goal = input(What was your favorite part of the book, + your_name + ?)
Here the concatenation operator +
combines those ingredients into a single string — and a string is the one argument that input
is expecting
Try this:
goal = input (What was your favorite part of the book, %s ? % your_name)
Python Error – TypeError: input expected at most 1 arguments, got 3
input(print(What was your favorite part of the book, + your_name + ?))
Related posts
- python – Difference between numpy.dot and a.dot(b)
- list – What is the inverse function of zip in python?
- using py2exe on python 3.6 to convert .py to .exe
- Python regex – r prefix
- How do I get a decimal value when using the division operator in Python?
- python – How to sort multidimensional array by column?
- Purpose of return self python