TORONTO KIDS COMPUTER CLUB | TCMS 18:30 Python Homework 20.01.02.
16841
post-template-default,single,single-post,postid-16841,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

TCMS 18:30 Python Homework 20.01.02.

03 Jan TCMS 18:30 Python Homework 20.01.02.

Question 1.
Write a program to ask how many people. If there are more than 8 people, print message “No available seats”, otherwise print message “Seats are available”

Sample input 1:
How many people: 10

Sample output 1:
No available seats

Sample input 2:
How many people: 6

Sample output 2:
Seats are available


Question 2:
Write a program to ask user a number, and tells if the number is the multiple of 10.

Sample input 1:
90

Sample output 1:
90 is the multiple of 10

Sample input 2:
82

Sample output 2:
82 is not the multiple of 10


Question 3:
Write a program using while loop. The program will ask the user to enter an ingredient for pizza. Every time you enter an ingredient, the program will show the message “We will add …. into your pizza.”, until you enter “quit”.

Sample:
Please enter an ingredient for your pizza: mushroom
We will add mushroom into your pizza.
Please enter an ingredient for your pizza: green pepper
We will add green pepper into your pizza.
Please enter an ingredient for your pizza: cheese
We will add cheese into your pizza.
Please enter an ingredient for your pizza: quit


Question 4:
Write a program for a movie theater using while loop. It will keep asking your age and display the ticket price, until you enter “quit”. It is free if you are less than 3 years old, otherwise if your age is less than 16 years old or over 65 years old the ticket is $10, otherwise the price is $15.

Sample:
How old are you? 10
$10
How old are you? 2
Free
How old are you? 50
$15
How old are you? 67
$10
How old are you? quit

No Comments

Sorry, the comment form is closed at this time.