Question:
We have made the code in the class so that the barbarian could move towards bottom right and bounce inside the game window. Please make some modifications to the code so we could make the barbarian appears on the top instead of bouncing when the...
Posted at 05:06h
in
Uncategorized
by admin
Question 1:
Your hero has 4850 gold and start with level 1. Write a program to ask if you would like to spend 200 gold to upgrade your hero to a new level each time. If you agree to upgrade your hero, show hero’s new level and gold left over after...
Posted at 05:02h
in
Uncategorized
by admin
Question:Steve has a string of lowercase characters in range ascii[‘a’..’z’]. He wants to reduce the string to its shortest length by doing a series of operations. In each operation he selects a pair of adjacent lowercase letters that match, and he deletes them. For instance,...
Question:
Use input() to take 10 input from user, each item is separated by space. Then try to complete the following task:
Create a list from the input
Delete all repeated elements of the list.
Sample Input 1:
1 2 3 2 1 3 98 98 67
Sample...
Posted at 20:06h
in
Uncategorized
by admin
Question:
During this COVID19 outbreak, the gold price are very much unstable. Jack is very much tensed. He has asked Ken to analyze the gold price rate. Now Ken is given a report of N consecutive days containing gold price of those N consecutive days. Ken...
Posted at 17:18h
in
archives
by admin
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...