Posted at 00:42h
in
Uncategorized
by admin
Question:
Write a function luckySum(a, b, c) to calculate sum of given 3 int values, a b c. The function will have a return value of their sum. However, if one of the values is 13 then it does not count towards the sum and values to its...
Problem DescriptionBarbara plants N different sunflowers, each with a unique height, ordered from smallest to largest, and records their heights for N consecutive days. Each day, all of her flowers grow taller than they were the day before.
She records each of these measurements in a...
Posted at 00:33h
in
archives
by admin
Question:
Please write a program using function. Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:
if a player wins 5 or 6 games, they are placed...
Posted at 00:29h
in
Uncategorized
by admin
Problem DescriptionAnna and Jack are playing a game.
Each player starts with 100 points. The game uses standard six-sided dice and is played in rounds. During one round, each player rolls one die. The player with the lower roll loses the number of points shown on...
Question 1:
Create a Tank object which have the attributes of:
name
direction(up/down/left/right)
x position and
y position
The object also have a method:
move (direction, steps)
Using __init__ to Initial the tank to make sure it start from x position of 0 and y position of 0
Use print(tank...
Posted at 00:23h
in
Uncategorized
by admin
Question:
You’re on a long car trip and arrive at a gas station. It’s 200 km to the next station. Write a program to figure out if you need to buy gas here, or if you can wait for the next station.
The program should ask these questions, Input Sample:
How...