02 Nov Friday 17:00 Python Practice 20.10.30
Question: Continue modify the program we made in the class: The fighter will explode if the enemy or the bullet touches the fighter. ...
Question: Continue modify the program we made in the class: The fighter will explode if the enemy or the bullet touches the fighter. ...
Question 1: Write a program using while loop. The program will ask the user to enter an ingredient for pizza. Every time you enter an ingredient, the program will show the message “We will add …. into your pizza.”, until you enter “quit”. Sample: Please enter an ingredient...
Continue with the code in the previous class, add a button with the sign % which will find the remainder of two numbers....
Question: write a program to ask user about the date(year, month and day), then calculate the day of the year. Sample input: Year: 2016 Month: 6 Day: 23 Sample output: Day of the year: 175 Hint: You need consider leap years and non leap years, in order to do easier calculation, you may...
Question 1. Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this: Sample Input: Which multiplication table would you like? 5 Sample Output: Here’s your table: 5 x 1 = 5 5 x 2...
Question:Create a Time class and initialize it with hours and minutes. Make a method addTime which should take two time object and add them. E.g.- (2 hour and 50 min)+(1 hr and 20 min) is (4 hr and 10 min) Make a method displayTime which should print...
Question: The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult’s health. The doctor measures the patient’s height (in meters) and weight (in kilograms), then calculates the BMI using the formula BMI = weight / (height * height) Write a program which...
Question: Continue modify the program we made in the class: use spritecollide to let the fighter collect energy crystals, if the energy crystal is collected, the score will increase show bigboy large enemy spaceship on the screen, it will move slowly from top of the screen to the...
Question 1: 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 1: Continue coding the program we did in the class, so the program will tell you whether you can pay in the zone: height color zone if<90 red 1 elif<105 blue 1, 2 elif <120 green 1,2,3 elif <135 yellow 1,2,3,4,5 elif <150 purple 4,5 else white 6 Please continue coding the following program: print('Welcome to the adventureland!') while True: h = int(input('Height:')) if h...