TORONTO KIDS COMPUTER CLUB | Tuesday Python Homework 18:30 – 22.08.02.
20933
post-template-default,single,single-post,postid-20933,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Tuesday Python Homework 18:30 – 22.08.02.

06 Aug Tuesday Python Homework 18:30 – 22.08.02.

Question 1:
Use recursion to write a function divides_all that consumes a list of positive integers seq and a positive integer factor. Your function should produce True if every item in seq is a multiple of factor and False otherwise. The helper function is_multiple has been provided for you.


Question 2:
Use recursion to write a function reverse that consumes a list seq and produces a new list with the same items as seq but in reverse order. A list of length zero or one is its own reverse.

No Comments

Sorry, the comment form is closed at this time.