w07_markusboyagao

.py

School

University of Toronto *

*We aren’t endorsed by this school

Course

108

Subject

Computer Science

Date

Oct 30, 2023

Type

py

Pages

1

Uploaded by ProfessorMoonStingray31

Report
"""Week 7 Perform - Part 2""" # file name: w07_markus.py # # Complete the following steps: # (1) Complete the following function according to its docstring. # (2) Save your file after you make changes, and then run the file by # clicking on the green Run button in Wing101. This will let you call your # modified function in the Python shell. An asterisk * on the Wing101 # w06_markus.py tab indicates that modifications have NOT been saved. # (3) Test your function in the Wing101 shell by evaluating the examples from # the docstring and confirming that the correct result is displayed. # (4) Test your function using different function arguments. # (5) When you are convinced that your function is correct, submit your # modified file to MarkUs. You can find instructions on submitting a file # to MarkUs in Week *2* Perform -> Accessing Part 2 of the # Week 2 Perform (For Credit) on PCRS. # (6) Verify you have submitted the right file to MarkUs by downloading it # and checking that the downloaded file is the one you meant to submit. # (7) We have also provided a checker test for you to run on MarkUs. Click on # the Automated Testing tab and then Run tests to make sure your code # passes our simple test case. Go back to step (1) if errors were reported # and modify your work. You may need to click on some arrows to see all # of the error report. Note that we will run additional tests when we mark # your submission. def count_odds(values: list[list[int]]) -> list[int]: """Return a list of counts of odd numbers in each of the inner lists of values. >>> count_odds([[111, 165, 207]]) [3] >>> count_odds([[1, 2], [8], [5, 6, 7]]) [1, 0, 2] """ result = [] for sublist in values: odd_count = 0 for num in sublist: if num % 2 != 0: odd_count = odd_count + 1 result.append(odd_count) return result
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help

Browse Popular Homework Q&A

Q: Solve each application problem (please show your work and label your answers appropr 7. Suppose you…
Q: The marginal revenue from selling x cameras is 105−0.06x dollars per camera. Find the revenue…
Q: Use the following information for the Exercises below. (Algo) [The following information applies to…
Q: of answer choices XYZ has a revenue of $10,000. XYZ has an expense of $10,000. XYZ decreases it
Q: So, what does any of this have to do with the cloud and fog computing worlds?
Q: Complete the second PrintSalutation function to print the following given personName "Holly" and…
Q: Thomas Hancock has been the administrator of the clinical laboratories of a large urban hospital for…
Q: lect the statement that correctly describes the argument below. →q V¬q - pvq O The argument is…
Q: After receiving a heavy dose of antibiotics while in the hospital, a patient experienced continuous…
Q: Before changes to its management staff, an automobile assembly line operation had a scheduled mean…
Q: What criteria will you use to determine the best plan of action?
Q: The Consumer Price Index has risen from 110 to 121 during the last year. We should estimate the…
Q: How many kilocalories are needed to convert 18 g of ice at 0 °C to steam at 100 °C? (Hint: The…
Q: Find the matrix of the mirror reflection about the x-z plane in R³.
Q: Discuss the pathophysiology of heart failure from the perspective of the following systems listed…
Q: A sample of pond water is evaluated for bacteria by counting the number bacterial rRNA genes per…
Q: One end of a wire is attached to a ceiling, and a solid brass ball is tied to the lower end. The…
Q: 2 In the graph above, the equilibrium price and quantity for soybeans in this market is:
Q: Because colas tend to replace healthier beverages and colas contain caffeine and phosphoric acid,…
Q: John is standing on a boat dock at the water's edge on a hot summer day throwing stones into the…
Q: Recall on February 1, Derrick Company established a $200 petty cash fund. On February 15, when the…
Q: 1, 3 8 15 24 ..) 4'9' 16' 25'**