TORONTO KIDS COMPUTER CLUB | Aurora Monday 18:30 Homework
119
archive,category,category-aurora-monday-1830-homework,category-119,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Aurora Monday 18:30 Homework

24 Apr Aurora Monday 18:30 Python Homework 22.04.18.

Question 1: The hailstone sequence starting at a positive integer n is generated by following two simple rules. If n is even, the next number in the sequence is n/2. If n is odd, the next number in the sequence is 3*n+1. Repeating this process, we generate the hailstone sequence. Write a recursive function hailstone(n) which prints the...

Read More

15 Apr Aurora Monday 18:30 Python Homework 22.04.11.

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...

Read More