I&C SCI 32 Lecture 3: sum_numbers3.py

42 views1 pages

Document Summary

# this function sums the integers in a list containing *either* integers. # of sublists that are flat lists of integers. # one interesting new tidbit here that you might not have seen is that you. # check the type of an object. type(x) is a function that returns the. # type of the object x; you can compare types using == the same way you. # which allows us to distinguish between elements that are integers and. # elements that are sublists. def sum_numbers(numlist: [int or [int]]) -> int:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions