Not enough values to unpack expected 3 got 2 ошибка

1. First should understand the error meaning

Error not enough values to unpack (expected 3, got 2) means:

a 2 part tuple, but assign to 3 values

and I have written demo code to show for you:


#!/usr/bin/python
# -*- coding: utf-8 -*-
# Function: Showing how to understand ValueError 'not enough values to unpack (expected 3, got 2)'
# Author: Crifan Li
# Update: 20191212

def notEnoughUnpack():
    """Showing how to understand python error `not enough values to unpack (expected 3, got 2)`"""
    # a dict, which single key's value is two part tuple
    valueIsTwoPartTupleDict = {
        "name1": ("lastname1", "email1"),
        "name2": ("lastname2", "email2"),
    }

    # Test case 1: got value from key
    gotLastname, gotEmail = valueIsTwoPartTupleDict["name1"] # OK
    print("gotLastname=%s, gotEmail=%s" % (gotLastname, gotEmail))
    # gotLastname, gotEmail, gotOtherSomeValue = valueIsTwoPartTupleDict["name1"] # -> ValueError not enough values to unpack (expected 3, got 2)

    # Test case 2: got from dict.items()
    for eachKey, eachValues in valueIsTwoPartTupleDict.items():
        print("eachKey=%s, eachValues=%s" % (eachKey, eachValues))
    # same as following:
    # Background knowledge: each of dict.items() return (key, values)
    # here above eachValues is a tuple of two parts
    for eachKey, (eachValuePart1, eachValuePart2) in valueIsTwoPartTupleDict.items():
        print("eachKey=%s, eachValuePart1=%s, eachValuePart2=%s" % (eachKey, eachValuePart1, eachValuePart2))
    # but following:
    for eachKey, (eachValuePart1, eachValuePart2, eachValuePart3) in valueIsTwoPartTupleDict.items(): # will -> ValueError not enough values to unpack (expected 3, got 2)
        pass

if __name__ == "__main__":
    notEnoughUnpack()

using VSCode debug effect:

notEnoughUnpack CrifanLi

2. For your code

for name, email, lastname in unpaidMembers.items():

but error
ValueError: not enough values to unpack (expected 3, got 2)

means each item(a tuple value) in unpaidMembers, only have 1 parts:email, which corresponding above code

    unpaidMembers[name] = email

so should change code to:

for name, email in unpaidMembers.items():

to avoid error.

But obviously you expect extra lastname, so should change your above code to

    unpaidMembers[name] = (email, lastname)

and better change to better syntax:

for name, (email, lastname) in unpaidMembers.items():

then everything is OK and clear.

import cv2
import numpy as np
import math

def distance(x1, y1, x2, y2):
«»»
Calculate distance between two points
«»»
dist = math.sqrt(math.fabs(x2-x1)**2 + math.fabs(y2-y1)**2)
return dist

def find_color1(frame):
«»»
Filter «frame» for HSV bounds for color1 (inplace, modifies frame) & return coordinates of the object with that color
«»»
hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
hsv_lowerbound = np.array([102, 152, 0]) #replace THIS LINE w/ your hsv lowerb
hsv_upperbound = np.array([118, 255, 255])#replace THIS LINE w/ your hsv upperb
mask = cv2.inRange(hsv_frame, hsv_lowerbound, hsv_upperbound)
res = cv2.bitwise_and(frame, frame, mask=mask) #filter inplace
, cnts, = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
if len(cnts) > 0:
maxcontour = max(cnts, key=cv2.contourArea)

    #Find center of the contour 
    M = cv2.moments(maxcontour)
    if M['m00'] > 0 and cv2.contourArea(maxcontour) > 1000:
        cx = int(M['m10']/M['m00'])
        cy = int(M['m01']/M['m00'])
        return (cx, cy), True
    else:
        return (700, 700), False #faraway point
else:
    return (700, 700), False #faraway point

def find_color2(frame):
«»»
Filter «frame» for HSV bounds for color1 (inplace, modifies frame) & return coordinates of the object with that color
«»»
hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
hsv_lowerbound = np.array([40, 83, 0])#replace THIS LINE w/ your hsv lowerb
hsv_upperbound = np.array([101, 255, 255])#replace THIS LINE w/ your hsv upperb
mask = cv2.inRange(hsv_frame, hsv_lowerbound, hsv_upperbound)
res = cv2.bitwise_and(frame, frame, mask=mask)
,cnts, = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
if len(cnts) > 0:
maxcontour = max(cnts, key=cv2.contourArea)

    #Find center of the contour 
    M = cv2.moments(maxcontour)
    if M['m00'] > 0 and cv2.contourArea(maxcontour) > 2000:
        cx = int(M['m10']/M['m00'])
        cy = int(M['m01']/M['m00'])
        return (cx, cy), True #True
    else:
        return (700, 700), True #faraway point
else:
    return (700, 700), True #faraway point

cap = cv2.VideoCapture(0)

while(1):
_, orig_frame = cap.read()

if orig_frame is None:
    break


#we'll be inplace modifying frames, so save a copy
copy_frame = orig_frame.copy() 
(color1_x, color1_y), found_color1 = find_color1(copy_frame)
(color2_x, color2_y), found_color2 = find_color2(copy_frame)

#draw circles around these objects
cv2.circle(copy_frame, (color1_x, color1_y), 20, (255, 0, 0), -1)
cv2.circle(copy_frame, (color2_x, color2_y), 20, (0, 128, 255), -1)

if found_color1 and found_color2:
    #trig stuff to get the line
    hypotenuse = distance(color1_x, color1_x, color2_x, color2_y)
    horizontal = distance(color1_x, color1_y, color2_x, color1_y)
    vertical = distance(color2_x, color2_y, color2_x, color1_y)
    angle = np.arcsin(vertical/hypotenuse)*180.0/math.pi

    #draw all 3 lines
    cv2.line(copy_frame, (color1_x, color1_y), (color2_x, color2_y), (0, 0, 255), 2)
    cv2.line(copy_frame, (color1_x, color1_y), (color2_x, color1_y), (0, 0, 255), 2)
    cv2.line(copy_frame, (color2_x, color2_y), (color2_x, color1_y), (0, 0, 255), 2)

    #put angle text (allow for calculations upto 180 degrees)
    angle_text = ""
    if color2_y < color1_y and color2_x > color1_x:
        angle_text = str(int(angle))
    elif color2_y < color1_y and color2_x < color1_x:
        angle_text = str(int(180 - angle))
    elif color2_y > color1_y and color2_x < color1_x:
        angle_text = str(int(180 + angle))
    elif color2_y > color1_y and color2_x > color1_x:
        angle_text = str(int(360 - angle))
    
    #CHANGE FONT HERE
    cv2.putText(copy_frame, angle_text, (color1_x-30, color1_y), cv2.FONT_HERSHEY_COMPLEX, 1, (0, 128, 229), 2)

cv2.imshow('AngleCalc', copy_frame)
cv2.waitKey(5) 

cap.release()
cv2.destroyAllWindows()

error

Traceback (most recent call last):
File «C:/Users/Besitzer/Real-Time-and-Static-Angles-Calculation-main/Real-Time-and-Static-Angles-Calculation-main/Angle_Findings Taha/color_based.py», line 72, in
(color1_x, color1_y), found_color1 = find_color1(copy_frame)
File «C:/Users/Besitzer/Real-Time-and-Static-Angles-Calculation-main/Real-Time-and-Static-Angles-Calculation-main/Angle_Findings Taha/color_based.py», line 21, in find_color1
, cnts, = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
[ WARN:1@4.056] global D:aopencv-pythonopencv-pythonopencvmodulesvideoiosrccap_msmf.cpp (539) `anonymous-namespace’::SourceReaderCB::~SourceReaderCB terminating async callback

Process finished with exit code 1

На чтение 5 мин Просмотров 19.6к. Опубликовано 22.11.2021

В этой статье мы рассмотрим из-за чего возникает ошибка ValueError: too many values to unpack и как ее исправить в Python.

Содержание

  1. Введение
  2. Что такое распаковка в Python?
  3. Распаковка списка в Python
  4. Распаковка списка с использованием подчеркивания
  5. Распаковка списка с помощью звездочки
  6. Что значит ValueError: too many values to unpack?
  7. Сценарий 1: Распаковка элементов списка
  8. Решение
  9. Сценарий 2: Распаковка словаря
  10. Решение
  11. Заключение

Введение

Если вы получаете ValueError: too many values to unpack (expected 2), это означает, что вы пытаетесь получить доступ к слишком большому количеству значений из итератора.

Ошибка Value Error — это стандартное исключение, которое может возникнуть, если метод получает аргумент с правильным типом данных, но недопустимым значением, или если значение, предоставленное методу, выходит за пределы допустимого диапазона.

В этой статье мы рассмотрим, что означает эта ошибка, в каких случаях она возникает и как ее устранить на примерах.

Что такое распаковка в Python?

В Python функция может возвращать несколько значений, и они могут быть сохранены в переменной. Это одна из уникальных особенностей Python по сравнению с другими языками, такими как C++, Java, C# и др.

Распаковка в Python — это операция, при которой значения итерабильного объекта будут присвоена кортежу или списку переменных.

Распаковка списка в Python

В этом примере мы распаковываем список элементов, где каждый элемент, который мы возвращаем из списка, должен присваиваться переменной в левой части для хранения этих элементов.

one, two, three = [1, 2, 3]

print(one)
print(two)
print(three)

Вывод программы

Распаковка списка с использованием подчеркивания

Подчеркивание чаще всего используется для игнорирования значений; когда _ используется в качестве переменной, когда мы не хотим использовать эту переменную в дальнейшем.

one, two, _ = [1, 2, 3]

print(one)
print(two)
print(_)

Вывод программы

Распаковка списка с помощью звездочки

Недостаток подчеркивания в том, что оно может хранить только одно итерируемое значение, но что если у вас слишком много значений, которые приходят динамически?

Здесь на помощь приходит звездочка. Мы можем использовать переменную со звездочкой впереди для распаковки всех значений, которые не назначены, и она может хранить все эти элементы.

one, two, *z = [1, 2, 3, 4, 5, 6, 7, 8]

print(one)
print(two)
print(z)

Вывод программы

После того, как мы разобрались с распаковкой можно перейти к нашей ошибке.

Что значит ValueError: too many values to unpack?

ValueError: too many values to unpack возникает при несоответствии между возвращаемыми значениями и количеством переменных, объявленных для хранения этих значений. Если у вас больше объектов для присвоения и меньше переменных для хранения, вы получаете ошибку значения.

Ошибка возникает в основном в двух сценариях

Сценарий 1: Распаковка элементов списка

Давайте рассмотрим простой пример, который возвращает итерабильный объект из четырех элементов вместо трех, и у нас есть три переменные для хранения этих элементов в левой части.

В приведенном ниже примере у нас есть 3 переменные one, two, three но мы возвращаем 4 итерабельных элемента из списка.

one, two, three = [1, 2, 3, 4]

Вывод программы

Traceback (most recent call last):
  File "/Users/krnlnx/Projects/Test/test.py", line 1, in <module>
    one, two, three = [1, 2, 3, 4]
ValueError: too many values to unpack (expected 3)

Решение

При распаковке списка в переменные количество переменных, которые вы хотите распаковать, должно быть равно количеству элементов в списке.

Если вы уже знаете количество элементов в списке, то убедитесь, что у вас есть равное количество переменных в левой части для хранения этих элементов для решения.

Если вы не знаете количество элементов в списке или если ваш список динамический, то вы можете распаковать список с помощью оператора звездочки. Это обеспечит хранение всех нераспакованных элементов в одной переменной с оператором звездочка.

Сценарий 2: Распаковка словаря

В Python словарь — это набор неупорядоченных элементов, содержащих пары ключ-значение. Рассмотрим простой пример, который состоит из трех ключей, и каждый из них содержит значение, как показано ниже.

Если нам нужно извлечь и вывести каждую из пар ключ-значение в словаре, мы можем использовать итерацию элементов словаря с помощью цикла for.

Давайте запустим наш код и посмотрим, что произойдет

city = {"name": "Saint Petersburg", "population": 5000000, "country": "Russia"}

for k, v in city:
    print(k, v)

Вывод программы

Traceback (most recent call last):
  File "/Users/krnlnx/Projects/Test/test.py", line 3, in <module>
    for k, v in city:
ValueError: too many values to unpack (expected 2)

В приведенном выше коде мы получаем ошибку, потому что каждый элемент в словаре «city» является значением.

В Python мы не должны рассматривать ключи и значения в словаре как две отдельные сущности.

Решение

Мы можем устранить ошибку с помощью метода items(). Функция items() возвращает объект представления, который содержит обе пары ключ-значение, сохраненные в виде кортежей.

Подробнее про итерацию словаря читайте по ссылке.

city = {"name": "Saint Petersburg", "population": 5000000, "country": "Russia"}

for k, v in city.items():
    print(k, v)

Вывод программы

name Saint Petersburg
population 5000000
country Russia

Примечание: Если вы используете Python 2.x, вам нужно использовать функцию iteritems() вместо функции items().

Заключение

В этой статье мы рассмотрели, почему в Python возникает ошибка «ValueError: too many values to unpack », разобрались в причинах и механизме ее возникновения. Мы также увидели, что этой ошибки можно избежать.

  1. What Is a ValueError in Python
  2. Fix ValueError: not enough values to unpack in Python Dictionaries
  3. Fix ValueError: not enough values to unpack in Python

ValueError: Not Enough Values to Unpack in Python

It is a common error when you are freshly getting your hands dirty with Python programming, or sometimes it could be a type error that you provide more values but fewer variables (containers) to catch those values. Or when you try to iterate over a dictionary’s values or keys but try to access both simultaneously.

This article will look at each scenario in detail along with examples but before that, let’s understand what a ValueError is in Python.

What Is a ValueError in Python

A ValueError is a common exception in Python that occurs when the number of values doesn’t match the number of variables either taking input, direct assignment or through an array or accessing restricted values. To understand the ValueError, let’s take an example.

# this input statement expects three values as input
x,y,z = input("Enter values for x, y and z: ").split(",")

Output:

Enter values for x, y and z: 1,2
ValueError: not enough values to unpack (expected 3, got 2)

In the above example, we have three variables x,y,z to catch the input values, but we provide two input values to demonstrate the ValueError.

Now the input statement has three values, and since the user input values do not meet the expected condition, it throws the ValueError: not enough values to unpack (expected 3, got 2).

The error itself is self-explanatory; it tells us that the expected number of values is three, but you have provided 2.

A few other common causes of ValueError could be the following.

a,b,c = 3, 5      #ValueError: not enough values to unpack (expected 3, got 2)
a,b,c = 2  		  #ValueError: not enough values to unpack (expected 3, got 1)
a,b,d,e = [1,2,3] #ValueError: not enough values to unpack (expected 4, got 3)

Fix ValueError: not enough values to unpack in Python Dictionaries

In Python, a dictionary is another data structure whose elements are in key-value pairs, every key should have a corresponding value against the key, and you can access the values with their keys.

Syntax of a dictionary in Python:

student = {
    "name"    : "Zeeshan Afridi",
    "degree"  : "BSSE",
    "section" : "A"
}

This is the general structure of a dictionary; the values of the left are keys, whereas the others are values of the keys.

We have specified functions for Python, dictionaries like keys(), values(), items(), etc. But these are the most common and useful functions to loop through a dictionary.

print("Keys of Student dictionary: ", student.keys())
print("Values of Student dictionary: ", student.values())
print("Items of Student dictionary: ", student.items())

Output:

Keys of Student dictionary:  dict_keys(['name', 'degree', 'section'])
Values of Student dictionary:  dict_values(['Zeeshan Afridi', 'BSSE', 'A'])
Items of Student dictionary:  dict_items([('name', 'Zeeshan Afridi'), ('degree', 'BSSE'), ('section', 'A')])

Let’s see why the ValueError: not enough values to unpack occurs in Python dictionaries.

student = {
    #Keys     :  Values
    "name"    : "Zeeshan Afridi",
    "degree"  : "BSSE",
    "section" : "A"
}

#iterate user dictionary
for k,v,l in student.items(): # This statement throws an error
    print("Key:", k)
    print("Value:", str(v))

Output:

ValueError: not enough values to unpack (expected 3, got 2)

As you can see, the above code has thrown an error because the .items() functions expect two variables to catch the keys and values of the student dictionary, but we have provided three variables k,v,l.

So there isn’t any space for l in the student dictionary, and it throws the ValueError: not enough values to unpack (expected 3, got 2).

To fix this, you need to fix the variables of the dictionary.

for k,v in student.items()

This is the correct statement to iterate over a dictionary in Python.

Fix ValueError: not enough values to unpack in Python

To avoid such exceptions in Python, you should provide the expected number of values to the variables and display useful messages to guide yours during entering data into forms or any text fields.

In addition to that, you can use try-catch blocks to capture such errors before crashing your programs.

Let’s understand how to fix the ValueError: not enough values to unpack in Python.

# User message --> Enter three numbers to multiply  ::
x,y,z = input("Enter three numbers to multiply  ::  ").split(",")

# type casting x,y, and z
x = int(x)
y = int(y)
z = int(z)

prod = (x*y*z)

print("The product of x,y and z is  :: ",prod)

Output:

Enter three numbers to multiply  ::  2,2,2
The product of x,y and z is  ::  8

Here in this example, the input statement expects three inputs, and we have provided the expected number of inputs, so it didn’t throw any ValueError.

The error “too many values to unpack” is common in Python, you might have seen it while working with lists.

The Python error “too many values to unpack” occurs when you try to extract a number of values from a data structure into variables that don’t match the number of values. For example, if you try to unpack the elements of a list into variables whose number doesn’t match the number of elements in the list.

We will look together at some scenarios in which this error occurs, for example when unpacking lists, dictionaries or when calling Python functions.

By the end of this tutorial you will know how to fix this error if you happen to see it.

Let’s get started!

How Do You Fix the Too Many Values to Unpack Error in Python

What causes the too many values to unpack error?

This happens, for example, when you try to unpack values from a list.

Let’s see a simple example:

>>> week_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
>>> day1, day2, day3 = week_days

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: too many values to unpack (expected 3)

The error complains about the fact that the values on the right side of the expression are too many to be assigned to the variables day1, day2 and day3.

As you can see from the traceback this is an error of type ValueError.

So, what can we do?

One option could be to use a number of variables on the left that matches the number of values to unpack, in this case seven:

>>> day1, day2, day3, day4, day5, day6, day7 = week_days
>>> day1
'Monday'
>>> day5
'Friday'

This time there’s no error and each variable has one of the values inside the week_days array.

In this example the error was raised because we had too many values to assign to the variables in our expression.

Let’s see what happens if we don’t have enough values to assign to variables:

>>> weekend_days = ['Saturday' , 'Sunday']
>>> day1, day2, day3 = weekend_days

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: not enough values to unpack (expected 3, got 2)

This time we only have two values and we are trying to assign them to the three variables day1, day2 and day3.

That’s why the error says that it’s expecting 3 values but it only got 2.

In this case the correct expression would be:

>>> day1, day2 = weekend_days

Makes sense?

Another Error When Calling a Python Function

The same error can occur when you call a Python function incorrectly.

I will define a simple function that takes a number as input, x, and returns as output two numbers, the square and the cube of x.

>>> def getSquareAndCube(x):
        return x**2, x**3 
>>> square, cube = getSquareAndCube(2)
>>> square
4
>>> cube
8

What happens if, by mistake, I assign the values returned by the function to three variables instead of two?

>>> square, cube, other = getSquareAndCube(2)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: not enough values to unpack (expected 3, got 2)

We see the error “not enough values to unpack” because the value to unpack are two but the variables on the left side of the expression are three.

And what if I assign the output of the function to a single variable?

>>> output = getSquareAndCube(2)
>>> output
(4, 8)

Everything works well and Python makes the ouput variable a tuple that contains both values returned by the getSquareAndCube function.

Too Many Values to Unpack With the Input Function

Another common scenario in which this error can occur is when you use the Python input() function to ask users to provide inputs.

The Python input() function reads the input from the user and it converts it into a string before returning it.

Here’s a simple example:

>>> name, surname = input("Enter your name and surname: ")
Enter your name and surname: Claudio Sabato

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    name, surname = input("Enter your name and surname: ")
ValueError: too many values to unpack (expected 2)

Wait a minute, what’s happening here?

Why Python is complaining about too many values to unpack?

That’s because the input() function converts the input into a string, in this case “Claudio Sabato”, and then it tries to assign each character of the string to the variables on the left.

So we have multiple characters on the right part of the expression being assigned to two variables, that’s why Python is saying that it expects two values.

What can we do about it?

We can apply the string method split() to the ouput of the input function:

>>> name, surname = input("Enter your name and surname: ").split()
Enter your name and surname: Claudio Sabato
>>> name
'Claudio'
>>> surname
'Sabato'

The split method converts the string returned by the input function into a list of strings and the two elements of the list get assigned to the variables name and surname.

By default, the split method uses the space as separator. If you want to use a different separator you can pass it as first parameter to the split method.

Using Maxsplit to Solve This Python Error

There is also another way to solve the problem we have observed while unpacking the values of a list.

Let’s start again from the following code:

>>> name, surname = input("Enter your name and surname: ").split()

This time I will provide a different string to the input function:

Enter your name and surname: Mr John Smith

Traceback (most recent call last):
  File "<pyshell#29>", line 1, in <module>
    name, surname = input("Enter your name and surname: ").split()
ValueError: too many values to unpack (expected 2)

In a similar way as we have seen before, this error occurs because split converts the input string into a list of three elements. And three elements cannot be assigned to two variables.

There’s a way to tell Python to split the string returned by the input function into a number of values that matches the number of variables, in this case two.

Here is the generic syntax for the split method that allows to do that:

<string>.split(separator, maxsplit)

The maxsplit parameter defines the maximum number of splits to be used by the Python split method when converting a string into a list. Maxsplit is an optional parameter.

So, in our case, let’s see what happens if we set maxsplit to 1.

>>> name, surname = input("Enter your name and surname: ").split(' ', 1)

Enter your name and surname: Mr John Smith
>>> name
'Mr'
>>> surname
'John Smith'

The error is gone, the logic of this line is not perfect considering that surname is ‘John Smith’. But this is just an example to show how maxsplit works.

So, why are we setting maxsplit to 1?

Because in this way the string returned by the input function is only split once when being converted into a list, this means the result is a list with two elements (matching the two variables on the left of our expression).

Too Many Values to Unpack with Python Dictionary

In the last example we will use a Python dictionary to explain another common error that shows up while developing.

I have created a simple program to print every key and value in the users dictionary:

users = {
    'username' : 'codefather',
    'name' : 'Claudio',
}

for key, value in users:
    print(key, value)

When I run it I see the following error:

$ python dict_example.py

Traceback (most recent call last):
  File "dict_example.py", line 6, in <module>
    for key, value in users:
ValueError: too many values to unpack (expected 2)

Where is the problem?

Let’s try to execute a for loop using just one variable:

for user in users:
    print(user)

The output is:

$ python dict_example.py
username
name

So…

When we loop through a dictionary using its name we get back just the keys.

That’s why we were seeing an error before, we were trying to unpack each key into two variables: key and value.

To retrieve each key and value from a dictionary we need to use the dictionary items() method.

Let’s run the following:

for user in users.items():
    print(user)

This time the output is:

('username', 'codefather')
('name', 'Claudio')

At every iteration of the for loop we get back a tuple that contains a key and its value. This is definitely something we can assign to the two variables we were using before.

So, our program becomes:

users = {
    'username' : 'codefather',
    'name' : 'Claudio',
}

for key, value in users.items():
    print(key, value)

The program prints the following output:

$ python dict_example.py
username codefather
name Claudio

All good, the error is fixed!

Conclusion

We have seen few examples that show when the error “too many values to unpack” occurs and how to fix this Python error.

In one of the examples we have also seen the error “not enough values to unpack”.

Both errors are caused by the fact that we are trying to assign a number of values that don’t match the number of variables we assign them to.

And you? Where are you seeing this error?

Let me know in the comments below 🙂

I have also created a Python program that will help you go through the steps in this tutorial. You can download the source code here.

Claudio Sabato - Codefather - Software Engineer and Programming Coach

I’m a Software Engineer and Programming Coach. I want to help you in your journey to become a Super Developer!

Возможно, вам также будет интересно:

  • Not another pdf scanner 2 ошибка драйвера сканирования
  • Not allowed to load local resource ошибка
  • Not all variables bound oracle ошибка
  • Not all arguments converted during string formatting ошибка питон
  • Not all arguments converted during string formatting python ошибка

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии