TORONTO KIDS COMPUTER CLUB | Wed Fri 15:00 Homework
138

# Wed Fri 15:00 Homework

## 26 MayMonday 20:00 Python Practice 21.05.24.

Question 1:Use recursion to write a function has_digit  that consumes a string and produces True  if the string contains a digit (0 through 9) and False  otherwise. Hints: Make sure that you have a base case. Make sure to use the function on a shorter string. Before calling the function, first check to see...

## 24 MayMonday 20:00 Python Practice 21.05.17.

Question: Use the recursion we have learn in the class, please try to create a function to recursively calculate the total of 1 + 2 + …. (n-2) + (n-1) + n def total(n): # please write you program belowtotal(int(input('Please enter a number:'))) Class Notes: All...

## 11 MayMonday 20:00 Python Practice 21.05.10.

Question:A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a...

## 05 MayMonday 20:00 Python Practice 21.05.03.

Question:Base on the explanation about the deque data structure, please finish the following code: class Deque: def __init__(self): pass def isEmpty(self): pass def...

## 01 MayMonday 20:00 Python Practice 21.04.26.

Question: Problem DescriptionYou are trying to pass the time while at the optometrist. You notice there is a grid of four numbers: 1 2 3 4 You see lots of mirrors and lenses at the optometrist, and wonder how flipping the grid horizontally or vertically would change the grid. Specifically, a...

## 21 AprMonday 20:00 Python Practice 21.04.19.

Question 1:Modify the program we made in the class below, so you could convert decimal number into any base number between Binary(base 2 number ) to Hex(base 16 number): from stack import * def d2b(num): s = Stack() while num >...

## 18 AprMonday 20:00 Python Practice 21.04.12.

Question:During this COVID19 outbreak, the gold price are very much unstable. Jack is very much tensed. He has asked Ken to analyze the gold price rate. Now Ken is given a report of N consecutive days containing gold price of those N consecutive days. Ken...

## 11 AprMonday 20:00 Python Practice 21.04.05.

Question: You are given an array A of Q integers and Q queries. In each query, you are given an integer i (1≤i≤N).Your task is to find the minimum index greater than i (1≤i≤N) such that:Sum of digits of Ai is greater than the sum of digits of AjAi < AjIf there is no answer, then print -1. Input formatThe first line contains two numbers N and Q.The...

## 02 AprMonday 20:00 Python Practice 21.03.29.

Question:Steve has a string of lowercase characters in range ascii[‘a’..’z’]. He wants to reduce the string to its shortest length by doing a series of operations. In each operation he selects a pair of adjacent lowercase letters that match, and he deletes them. For instance,...

## 27 MarMonday 20:00 Python Practice 21.03.22.

Question:Create Card class so it can complete the following tasks: Card() – You can initial the card with random value (Assume the smallest card value is ‘2’, then followed by ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ’10’, ‘J’, ‘Q’, ‘K’, ‘A’) and according rank (integer...