TORONTO KIDS COMPUTER CLUB | archives
141

# archives

## 14 DecTuesday 17:00 Python Practice – 22.12.13.

Question 1: The general problem of balancing and nesting different kinds of opening and closing symbols occurs frequently. Strings of symbols such as { { ( [ ] [ ] ) } ( ) } [ [ { { ( ( ) ) } } ] ] [ ] [...

## 11 DecTuesday 17:00 Python Practice – 22.12.06.

Question: We have learned infix, prefix and postfix, please write the missing prefix and postfix in the table blow: infix prefix postfix A+B +AB AB+ A+B*C +A*BC ABC*+ (A+B)*C *+ABC AB+C* A+B*C+D ++A*BCD ABC*+D+ (A+B)*(C+D) A*B+C*D A+B+C+D ...

## 04 DecTuesday 17:00 Python Practice – 22.11.29.

Problem Description  Suppose we have a number like 12. Let’s define shifting a number to mean adding a zero at the end. For example, if we shift that number once, we get the number 120. If we shift the number again we get the number 1200....

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