Monday, July 4, 2022
HomeCyber SecurityValueError: too many values to unpack (anticipated 2) | by Teri Radichel...

ValueError: too many values to unpack (anticipated 2) | by Teri Radichel | Bugs That Chew | Jul, 2022


Too many values handed again from a python perform

Python differs from another languages in which you can move again a number of values from a perform. The variety of values that you just retrieve from a perform must match the variety of values that you just return from the perform.

For instance, when you have this perform:

def funkyfunk(test1, test2, test3):
#do one thing with values
return test1, test2, test3

and you then name the perform like this:

test1, test2 = funkyfunk(test1, test2, test3)

that causes this error:

ValueError: too many values to unpack (anticipated 2)

To repair it return three and skim three values:

def funkyfunk(test1, test2, test3):
#do one thing with values
return test1, test2, test3
test1, test2, test3 = funkyfunk(test1, test2, test3)

Teri Radichel

For those who appreciated this story please clap and comply with:

Medium: Teri Radichel or Electronic mail Listing: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests providers through LinkedIn: Teri Radichel or IANS Analysis

© 2nd Sight Lab 2022

____________________________________________

Creator:

Cybersecurity for Executives within the Age of Cloud on Amazon

Want Cloud Safety Coaching? 2nd Sight Lab Cloud Safety Coaching

Is your cloud safe? Rent 2nd Sight Lab for a penetration check or safety evaluation.

Have a Cybersecurity or Cloud Safety Query? Ask Teri Radichel by scheduling a name with IANS Analysis.

Cybersecurity & Cloud Safety Sources by Teri Radichel: Cybersecurity and Cloud safety courses, articles, white papers, shows, and podcasts



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments