TORONTO KIDS COMPUTER CLUB | Uncategorized
1
archive,paged,category,category-uncategorized,category-1,paged-85,category-paged-85,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Uncategorized

13 Feb Monday Online Python Homework 02.11.

Import practice: Question 1. Write a short program to generate a list of five random integer numbers from 1 to 20, and print them out. Question 2. Write a short program that prints out a random decimal number every 3 seconds for 30 seconds Bonus Question (Difficulty: Hard): Write a function to print your name...

Read More

22 Jan Sunday 9:45 Python Homework 01.20.

Question: Make a class definition for a  BankAccount. It should have attributes for : - its name (a string), - account number (a string or integer), - and balance (a float). It should have methods to: - make deposits with displaying the balance, - and make withdrawals with displaying the balance. Hint: ...

Read More

22 Jan Monday Online Python Homework 01.21.

Question: Make a class definition for a  BankAccount. It should have attributes for : - its name (a string), - account number (a string or integer), - and balance (a float). It should have methods to: - make deposits with displaying the balance, - and make withdrawals with displaying the balance. Hint: ...

Read More

18 Jan Monday Online Python Homework 01.14.

Question 1:(please use function that return a value) Write a program to display information to a driver based on his/her speed according to the following table: km/h over the limit Fine 1 to 20 $100 21 to 30 $270 31 or above $500 Sample Input 1: Enter the speed limit: 40 Enter the recorded speed of the...

Read More

19 Dec Monday Online Python Homework 12.17.

Question 1: 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" >>> vegetables = vegetables.split(", ") >>> vegetables ['carrots', 'potatoes', 'onions', 'leeks', 'celery'] >>> fruits = ['avocados', 'bananas', 'oranges', 'grapes', 'mangoes'] >>>",...

Read More

11 Dec Monday Online Python Homework 12.10.

Question 1. We have a list of following: zoo = ['monkeys', 'tigers', 'pandas', 'penguins', 'giraffes', 'hippos', 'bears'] how to retrieve a slice of list zoo, so you can get the following result? ['monkeys', 'pandas', 'giraffes', 'bears'] Question 2. How to get average number of the following  list mynumber? mynumber = ['3', '6', '2', '8',...

Read More

11 Dec Sunday 12:00 Python Homework 12.09.

Question: Using function or object method to write a program to return the number of times that the string "code" appears anywhere in the given string, except we'll accept any letter for the 'd', so "cope" and "cooe" count. For example: 'aaacodebbb' will have 1 "code" 'codexxcode' will have 2 "code" 'cozexxcope'...

Read More

11 Dec Sunday 9:45 Python Homework 12.09.

Question: The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult’s health. The doctor measures the patient’s height (in meters) and weight (in kilograms), then calculates the BMI using the formula BMI = weight / (height * height) Write a program which...

Read More