Posted at 19:26h
in
Uncategorized
by admin
Question:
Today in gym class, your class decided to play dodgeball, and Jack is selected as one of the team captains! N students are lined up in a row, waiting to be put on teams. Jack is allowed to pick multiple students as long as they are adjacent...
Question:
A new and upcoming artist has a unique way to create checkered patterns. The idea is to use an M-by-N canvas which is initially entirely black. Then the artist repeatedly chooses a row or column and runs their magic brush along the row or column....
Posted at 19:20h
in
Uncategorized
by admin
Question:
Since we have changed isKilled() method in the Enemy as following code:
def isKilled(self):
if self.hp <= 0:
return True
else:
return False
Modify the following program...
Question:A new and upcoming artist has a unique way to create checkered patterns. The idea is to use an M-by-N canvas which is initially entirely black. Then the artist repeatedly chooses a row or column and runs their magic brush along the row or column....
Posted at 19:02h
in
Uncategorized
by admin
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,...
Question:
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 will...