TORONTO KIDS COMPUTER CLUB | Saturday 16:30 Homework
155

# Saturday 16:30 Homework

## 23 NovSaturday 16:30 Python Practice – 22.11.19.

Question: Please refer to Pirateship class to create a class Enemy: Create one enemy on the screen The enemy will appear at the top of the screen when we start the game The enemy could bounce left-right The enemy will keep move down until to the...

## 16 NovSaturday 16:30 Python Practice – 22.11.12.

Question: We have learned how to make the pirate ship bouncing left and right, try the following: How to make the pirate ship move and  bounce diagonally when it reaches the edge ( the pirate ship image is 200px by 166px)...

## 11 NovSaturday 16:30 Python Practice – 22.11.05.

Question 1: Draw the following picture in the pygame window: (could be different color) Hint: using pygame.draw.circle Question 2: Draw below image using pygame. (could using different color) ...

## 27 OctSaturday 16:30 Python Practice – 22.10.22.

Question 1： 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: Question 2： Create...

## 20 OctSaturday 16:30 Python Practice – 22.10.15.

Question: Write a function luckySum(a, b, c) to calculate sum of given 3 int values, a b c. The function will have a return value of their sum. However, if one of the values is 13 then it does not count towards the sum and values to its...

## 13 OctSaturday 16:30 Python Practice – 22.10.08.

Question： Write a program that asks the user to enter his/her name, age, favorite color, and favorite food. Have the program save all four items to a text file called myinfo.txt, each one on a separate line....

## 05 OctSaturday 16:30 Python Practice – 22.10.01.

Question: Use input() to take 10 input from user, each item is separated by space. Then try to complete the following task: Create a list from the input Delete all repeated elements of the list. Sample Input 1: 1 2 3 2 1 3 98 98 67 Sample Output...

## 28 SepSaturday 16:30 Python Practice – 22.09.24.

Question: write a program to ask user about the date(year, month and day), then pass these year month and day as arguments to a function calcDay that return 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...

## 22 SepSaturday 16:30 Python Practice – 22.09.17.

Question: Given the list of student marks: marks = [62, 84, 74, 51, 98, 73, 77, 90, 85, 79, 65, 58, 74, 86] Write a function that takes in a list of arguments and then returns a list containing marks which are above average. Name the function whatever you like...

## 15 SepSaturday 16:30 Python Practice – 22.09.10.

Question: The factorial function (symbol: !) says to multiply all whole numbers from our chosen number down to 1. Examples: 4! = 4 × 3 × 2 × 1 = 24 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5040 1! = 1 Factorial is not defined for...