Workout #10: Summing Everything

Sep 23, 2021

This challenge asks you to redefine the mysum function we defined in chapter 1, such that it can take any number of arguments. The arguments must all be of the same type and know how to respond to the + operator. (Thus, the function should work with numbers, strings, lists, and tuples, but not with sets and dicts.)

TRY IT YOURSELF

ANSWER

https://colab.research.google.com/drive/101PGdPoUW5rcP-aEOpzg0GV9YDFgjx15?usp=sharing

--

--

Abish Pius
Abish Pius

Written by Abish Pius

Data Science Professional, Python Enthusiast, turned LLM Engineer

No responses yet