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

Uncategorized

24 Oct Sunday 9:45 Python Homework 10.21.

Question : write a program to ask user about the date(year, month and day), then calculate the day of the year.   Sample input: Year: 2016 Month: 6 Day: 23 Sample output: Day of the year: 175 Hint: You need consider leap years and non leap years, in order to do easier calculation, you may...

Read More

16 Oct Sunday 12:00 Python Homework 10.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

16 Oct Sunday 9:45 Python Homework 10.14.

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