Posted at 05:00h
in
Uncategorized
by admin
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...
Posted at 05:33h
in
Uncategorized
by admin
Question:
Please modify the fraction class we made in the class by adding a method called add(). The method will take 2 arguments top and bottom like:
def add(self, top, bottom):
so the fraction object can add another fraction top and bottom number, such as:
a = Fraction(3, 5)
a.add(1,...
Posted at 04:14h
in
upcoming events
by admin
Question 1:
Santa Claus is playing card game with his reindeer to decide which route he's going to take to send out the gifts. He is going to play six games. There are no ties. The gift route will be decided based on the results of...
Posted at 03:00h
in
Uncategorized
by admin
Question 1:
Write a function to find the factorial of a number. The function should take one number as an argument and print the factorial of that number
Input: 5
Output: 120
Hint: the factorial of 5 is 1 * 2 * 3 * 4 * 5 = 120...
Question
You supervise a small parking lot which has N parking spaces. Yesterday, you recorded which parking spaces were occupied by cars and which were empty. Today, you recorded the same information. How many of the parking spaces were occupied both yesterday and today?
Input Specification:The first line of input contains the...
Posted at 03:54h
in
archives
by admin
Question:
Using function or object method to write a program to return the number of times that the string “code” appears anywhere in the given string, except we’ll accept any letter for the ‘d’, so “cope” and “cooe” count.
For example:
‘aaacodebbb’ will have 1 “code”
‘codexxcode’ will have 2 “code”
‘cozexxcope’...