29 Jan Saturday 16:30 Python Practice – 23.01.28.
Question: How to create ending screen shows the following 3 lines of information: Game Over Your score is: ?? press space to restart and the game will be restarted if you press the space. ...
Question: How to create ending screen shows the following 3 lines of information: Game Over Your score is: ?? press space to restart and the game will be restarted if you press the space. ...
Question: Make changes of the program we made in the class, so the enemy spaceship could complete the following tasks: more new enemies will keep entering the game at the random x position from the top of the screen. the enemy can bounce back when...
Question: Write a program that asks the user to enter his/her name, age, favorite color, and favorite food. Have the program save all four items to a text file called myinfo.txt, each one on a separate line....
Question 2: Continue modify the program we made in the class, so the moon and reflection on the ocean will move towards the right side of the screen. ...
Question: Using split and join function of the list to change string "green,red,yellow,blue," into string: "green light* red light* yellow light* blue light* " Hint: >>> vegetables = "carrots, potatoes, onions, leeks, celery" >>> # string.split(separator) will split the string by separator, for example: >>> vegetables = vegetables.split(", ") >>> print(vegetables) ['carrots', 'potatoes', 'onions',...
Question: A class has been divided into groups of three. This division into groups might violate two types of constraints: some students must work together in the same group, and some students must work in separate groups. Your job is to determine how many of the constraints...
You can do Question 1~ 3 in Python IDLE: 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...
Question 1: You and your friend have come up with a way to send messages back and forth. Your friend can encode a message to you by writing down a positive integer N and a symbol. You can decode that message by writing out that symbol N times in a row...
Question: The Logging Company cuts a lot of trees. For management reasons, they want to produce a table of the total amount of wood cut every day. They have hired you, to help them produce the table. They’ve kept a log of trees logged, and they...
Question: Write a program to ask the user for five names. The program should store the names in a list, and print them all out at the end. It should look something like this: Sample input: Enter 5 names: Tony Paul Nick Michel Kevin Sample output: The names are Tony, Paul, Nick, Michel, Kevin Hint: You can use...