Posted at 02:26h
in
Uncategorized
by admin
Question:
Use input() to ask user to input 10 numbers. Store the elements in two different lists, make sure the elements in the first list are smaller than the second list.
Input Specification:
input 10 numbers in one line, each number is separated by a space.
Output Specification:
first line...
Question:You are hosting a party and do not have room to invite all of your friends. You use the following unemotional mathematical method to determine which friends to invite.
Number your friends 1,2,…,K and place them in a list in this order. Then perform m rounds....
Posted at 01:45h
in
Uncategorized
by admin
Question:
We have created class Laser, however we haven't put it into use, please make change in the main program so that the fighter can shoot laser when we press the mouse.
create a pygame.sprite.Group() for all the lasers.
every time you click down the mouse,...
Posted at 17:25h
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.
Input Specification:
The program should ask the question,...
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 an...
Posted at 17:20h
in
Uncategorized
by admin
Question:
Use TKinter to create 6 buttons as following picture:
...