Uncategorized
Home > Uncategorized (Page 76)
Posted at 01:43h
in
Uncategorized
by admin
Question:
Write a program, which will find all such numbers between 1000 and 3000 (both included) such that each digit of the number is an even number, for example, each digit of number 2446 and 2842 is an even number.
The numbers obtained should be printed in...
Posted at 14:13h
in
Uncategorized
by admin
Question:
Please refer to Ball class to create a class Enemy:
Create one enemy on the screen
The enemy will appear at the top of the screen when we start the game
The enemy could bounce left-right
The enemy will keep move down until to the...
Posted at 20:08h
in
Uncategorized
by admin
===============================
1. Variables
===============================
Question 1.1
Make a variable and assign a number to it (any number you like). Then display your variable using print.
Question 1.2
Modify your variable, either by replacing the old value with a new value, or by adding something to the old value. Display the new value using print.
Question...
Posted at 01:00h
in
Uncategorized
by admin
Question 1
Make a variable and assign a number to it (any number you like). Then display your variable using print.
Question 2
Modify your variable, either by replacing the old value with a new value, or by adding something to the old value. Display the new value using print.
Question 3
Make...
Posted at 00:20h
in
Uncategorized
by admin
Question 1:(please use function that return a value)
Write a program to display information to a driver based on his/her speed according to the following table:
km/h over the limit
Fine
1 to 20
$100
21 to 30
$270
31 or above
$500
Sample Input 1:
Enter the speed limit: 40
Enter the recorded speed of the...
Posted at 23:40h
in
Uncategorized
by admin
Question 1.
Use float() to create a number from a string like '12.34'. Make sure the result is really a number!
Question 2.
Try using int() to create an integer from a decimal number like 56.78. Did the answer get rounded up or down?
Question 3.
Try using int() to create...
Posted at 19:44h
in
Uncategorized
by admin
Question 1:
Create a list of numbers between 4 and 40 who are divisible by either 3 or 5
Sample Output:
[6,9,10,12,15,...
Posted at 02:57h
in
Uncategorized
by admin
Question:
Please make some modifications of the program we made in the class. Make ball appears on the top if the ball reaches the bottom, or appears at bottom when the ball reaches the top.
...
Posted at 02:23h
in
Uncategorized
by admin
Question:
Write a function to calculate the total value of some change—quarters, dimes, nickels, and pennies. The function should return the total value of the coins. Then write a program that calls the function. The output should look like this when it runs:
Sample input:
quarters: 3
dimes: 6
nickels: 7
pennies: 2
Sample output:
total is...
Posted at 02:41h
in
Uncategorized
by admin
Question 1:(if you did not do this question last week)
Draw the following picture in the pygame window: (could be different color)
Hint: using pygame.draw.circle
Question 2:
Draw below image using pygame. (could using different color)
...