15 Jan Wednesday 17:00 Python Practice – 23.01.11.
Question: Continue to program the code so the change sign (+/-) button, zero(0) button and decimal (.) button can work....
Question: Continue to program the code so the change sign (+/-) button, zero(0) button and decimal (.) button can work....
Question: We have learned how to make the pirate ship bouncing left and right, try the following: How to make the pirate ship move and bounce diagonally when it reaches the edge ( the pirate ship image is 200px by 166px) ...
Question: Alice took a clean sheet of paper and drew h horizontal and v vertical lines onto the paper. The horizontal lines have y-coordinates y1,…,yh, and the vertical lines have x-coordinates x1,…,xv. Given these coordinates, count the number of squares that appeared on the paper. (The whole boundary of the square has to be drawn. The inside...
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: Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes. Create a Perimeter() method to calculate the perimeter of the rectangle and a Area() method to calculate the area of the rectangle. Create a method display() that display the length, width, perimeter and area of an object created...
Question:Frank is a portfolio manager of a closed-end fund. Fund collects money (cash) from individual investors for a certain period of time and invests cash into various securities in accordance with fund’s investment strategy. At the end of the period all assets are sold out...