TORONTO KIDS COMPUTER CLUB | Blog
1815
paged,page-template,page-template-blog-large-image,page-template-blog-large-image-php,page,page-id-1815,paged-81,page-paged-81,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Blog

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

16 Apr Aurora Wednesday 18:30 Python Practice 22.04.13.

Question: Alice took a clean sheet of paper and drew h horizontal and v vertical lines onto the paper. The horizontal lines have y-coordinates y1,…,yh, and the vertical lines have x-coordinates x1,…,xv. Given these coordinates, count the number of squares that appeared on the paper. (The whole boundary of the square has to be drawn. The inside...

Read More