TORONTO KIDS COMPUTER CLUB | archives
141

# archives

## 08 MarAurora Tuesday 18:30 Python Test 22.03.08.

1. Which of the following is NOT a correct variable name? a) heightOfTable2 b) 2tableHeight c) height_of_table2 d) HeiGhtOf2TaBle 2. Which of the following is correct answer to get the remainder for 8 / 3? a) 8 // 3 b) 8 % 3 c) 8 mod 3 d) int(8/3) 3. Which of the following will get the integer result for 8 / 3? a) 8 // 3 b) int(8 /...

## 13 AugAurora Tuesday 10:30 Python Homework 21.08.10.

Question 1： Create a Tank class which have the attributes of: model direction(use ‘up’, ‘down’, ‘left’ or ‘right’) x position and y position The class also have the following method: move () method can change the x or y position by 10 base on the tank's direction....

## 10 AugAurora Tuesday 10:30 Python Test 21.08.10.

1. What is the output of print mystr * 2 if mystr = 'Hello World!'? A. Hello World * 2 B. Hello World! Hello World! C. Hello Hello D. mystr mystr2. Which of...

## 07 AugAurora Tuesday 10:30 Python Homework 21.08.03.

Question: A common problem in mathematics is to determine which quadrant a given point lies in. There are four quadrants, numbered from 1 to 4, as shown in the diagram below: For example, the point A, which is at coordinates (12, 5) lies in quadrant 1 since...

## 31 JulAurora Tuesday 10:30 Python Homework 21.07.27.

Question: You have come up with the following compression technique: for each symbol, write down the number of times it appears consecutively, followed by the symbol itself. This compression technique is called run-length encoding. Given a sequence of characters, write a program to encode them in this...

## 25 JulAurora Tuesday 10:30 Python Homework 21.07.20.

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

## 16 JulAurora Tuesday 10:30 Python Homework 21.07.13.

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

## 08 JulAurora Tuesday 10:30 Python Homework 21.07.06.

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

## 28 JunAurora Saturday 16:30 Python Homework 21.06.26.

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

## 22 JunAurora Saturday 16:30 Python Homework 21.06.19.

Question 1: Make a function that will allow you to print any name, address, street, city, state or province, zip or postal code, and country in the world. (Hint: It needs seven arguments. You can pass them as individual arguments or as a list.) Question 2: Write a function to calculate the total value of some...