Dunder Data Python Challenge Solutions 1–5
Published in
2 min readNov 17, 2021
The solutions to the five Dunder Data Python Challenges will be presented below. Try these challenges for yourself at python.dunderdata.com before looking at the solutions. Video solutions for all of the challenges are available on YouTube.
Challenge #1 (1pt)
Given a list of integers. Return the difference between the largest and smallest values.
def exercise_1(a_list):
"""
Parameters
----------
a_list : a list of integers
Returns
-------
an integer
"""
# YOUR CODE HERE
return max(a_list) - min(a_list)
Video solution to challenge #1
Challenge #2 (1pt)
Given any number of lists of integers, return the list with the largest total. Check the note below if you do not understand *lists
in the function signature.
def exercise_1(*lists):
"""
Parameters
----------
lists : a tuple of lists of integers
Returns
-------
a list
"""
# YOUR CODE HERE…