Posted at 04:42h
in
Uncategorized
by admin
Import practice:
Question 1.
Write a short program to generate a list of five random integer numbers from 1 to 20, and print them out.
Question 2.
Write a short program that prints out a random decimal number every 3 seconds for 30 seconds
Bonus Question (Difficulty: Hard):
Write a function to print your name...
Question:
Eric works in a door mat manufacturing company. One day, he designed a new door mat with the
following specifications:
◦ Mat size must be A x B. (A is an odd natural number, and B is 3 times A.)
◦ The design should have 'WELCOME' written in...
Question:
Modify the program we made in the class. Add one enemy spaceship to your program, the enemy spaceship will keep moving from left to right and right to left side of the screen.
You can also download the code from the following link:
Friday shooting Game
You can...
Posted at 18:09h
in
Uncategorized
by admin
Question 1:
Create a Tank object which have the attributes of:
name
direction(up/down/left/right)
x position and
y position
The Tank 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
Print...
Question:
Make a program to verify whether the credit card numbers from ABCD Bank are valid or not.
A valid credit card from ABCD Bank has the following characteristics:
It must start with a 4, 5 or 6.
It must contain exactly 16 digits.
It must only consist...
Question:
Make a program to verify whether the credit card numbers from ABCD Bank are valid or not.
A valid credit card from ABCD Bank has the following characteristics:
It must start with a 4, 5 or 6.
It must contain exactly 16 digits.
It must only consist...