TORONTO KIDS COMPUTER CLUB | Monday 17:30 Homework
147

# Monday 17:30 Homework

## 01 FebMonday 17:30 Python Practice – 23.01.30.

Question: Make changes of the program by creating Enemy class, so we can create an enemy object in the main program, the enemy spaceship could complete the following tasks: the enemy could appear at the top of the screen and bounce back and forth when it...

## 24 JanMonday 17:30 Python Practice – 23.01.23.

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) ...

## 22 JanMonday 17:30 Python Practice – 23.01.16.

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) ...

## 14 JanMonday 17:30 Python Practice – 23.01.09.

Question: Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes. Create a Perimeter() method to calculate the perimeter of the rectangle and a Area() method to calculate the area of ​​the rectangle. Create a method display() that display the length, width, perimeter and area of an object created...

## 14 DecMonday 17:30 Python Practice – 22.12.12.

Question 1: Create a Python class Person with attributes: name and age of type string. Create a display() method that displays the name and age of an object created via the Person class. Create a child class Student which inherits from the Person class and which also has a section attribute. Create a method displayStudent()...

## 11 DecMonday 17:30 Python Practice – 22.12.05.

Question 1: Create a Student class and make the following methods to : __init__() – Initialize it with name and roll number. __str__() – Display all information of the student. setAge() – It should assign age to student. setMarks() – It should assign marks to the...

## 04 DecMonday 17:30 Python Practice – 22.11.28.

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...

## 26 NovMonday 17:30 Python Practice – 22.11.21.

Question: You are given a string . Suppose a character ‘a’ occurs consecutively n times in the string. Replace these consecutive occurrences of the character ‘a’ with (n, ‘a’) in the string. Input Format:  A single line of input consisting of the string . Output Format: A single line of...

## 19 NovMonday 17:30 Python Practice – 22.11.14.

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...

## 11 NovMonday 17:30 Python Practice – 22.11.07.

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...