TORONTO KIDS COMPUTER CLUB | Tuesday Python 17:30
142

# Tuesday Python 17:30

## 18 JunTuesday 17:30 Python Homework 21.06.15.

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

## 11 JunTuesday 17:30 Python Homework 21.06.08.

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

## 07 JunTuesday 17:30 Python Homework 21.06.01.

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

## 26 MayTuesday 17:30 Python Homework 21.05.25.

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

## 24 MayTuesday 17:30 Python Homework 21.05.18.

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

## 16 MayTuesday 17:30 Python Homework 21.05.11.

Question: The International Standard Book Number (ISBN) is a 13-digit code for identifying books. These numbers have a special property for detecting whether the number was written correctly. The 1-3-sum of a 13-digit number is calculated by multiplying the digits alternately by 1’s and 3’s (see example)...

## 05 MayTuesday 17:30 Python Homework 21.05.04.

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

## 01 MayTuesday 17:30 Python Homework 21.04.27.

Question: write a program to ask user about the date(year, month and day), then calculate 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 non leap years, in order to do easier calculation, you may...

## 21 AprTuesday 17:30 Python Homework 21.04.20.

Question： Write a program to ask the user for five names. The program should store the names in a list, and print them all out at the end. It should look something like this: Sample input： Enter 5 names: Tony Paul Nick Michel Kevin Sample output： The names are Tony, Paul, Nick, Michel, Kevin Hint: You can use...

## 18 AprTuesday 17:30 Python Homework 21.04.13.

Question 1： Using split and join function of the list to change string "green,red,yellow,blue," into string: "green light* red light* yellow light* blue light* " Hint: >>> vegetables = "carrots, potatoes, onions, leeks, celery" >>> # string.split(separator) will split the string by separator, for example: >>> vegetables = vegetables.split(", ") >>> print(vegetables) ['carrots', 'potatoes',...