TORONTO KIDS COMPUTER CLUB | admin
1
archive,paged,author,author-admin,author-1,paged-45,author-paged-45,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Author: admin

24 Apr Friday 17:00 Python Homework 22.04.22

Question 1: Use while loop (NOT for loop) to create the multiplication table program. After asking which table the user wants, ask her how high the table should go. The output should look like this: Sample Input: Which multiplication table would you like? 7 How high do you want to go? 12 Sample Output: Here’s...

Read More

24 Apr Wednesday 17:00 Python Practice – 22.04.20.

Question: Using split and join function of the list to change string "green,red,yellow,blue," into string: "green light* red light* yellow light* blue light* " Hint: >>> vegetables = "carrots, potatoes, onions, leeks, celery" >>> # string.split(separator) will split the string by separator, for example: >>> vegetables = vegetables.split(", ") >>> print(vegetables) ['carrots', 'potatoes', 'onions',...

Read More

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