27 Mar Aurora Wednesday 18:30 Python Practice 21.03.24.
Question: Continue modify the program in the class, so the barbarian can move diagonally (means it can move not only x position also y position.) ...
Question: Continue modify the program in the class, so the barbarian can move diagonally (means it can move not only x position also y position.) ...
Question 1: Draw the following picture in the pygame window: (could be different color) Hint: using pygame.draw.circle Question 2: Draw below image using pygame. (could using different color) ...
Question: Define a class called Lunch. Its __init__() method should have two arguments: self and menu. Where menu is a string. Add a method called menu_price. It will involve a if statement: – if “menu 1” print(“Your choice:”, menu, “Price 12.00”) – if “menu 2” print(“Your...
Question 1: Create a Student class and make the following methods to : __init__() – Initialize it with name and roll number. __str__() – Display all information of the student. setAge() – It should assign age to student. setMarks() – It should assign marks to the...
Question: Create a Tank class which have the attributes of: name direction(use ‘up’, ‘down’, ‘left’ or ‘right’) x position and y position The class also have the following method: move (direction, steps) method can change the x or y position base on the direction and steps. it will...
Question: Make a class definition for a BankAccount. It should have attributes for : – its name (a string), – account number (a string or integer), – and balance (a float). It should have methods to: – make deposits with displaying the balance, – and make withdrawals with displaying the balance. Hint: ...
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...
Question 1:(please use function that return a value) Write a program to display information to a driver based on his/her speed according to the following table: km/h over the limit Fine 1 to 20 $100 21 to 30 $270 31 or above $500 Sample Input 1: Enter the speed limit: 40 Enter the recorded speed of the...
Question 1: Make a function that will allow you to print any name, address, street, city, state or province, zip or postal code, and country in the world. (Hint: It needs seven arguments. You can pass them as individual arguments or as a list.) Question 2: Write a function to calculate the total value of...
Question: Given the list of student marks: notes = [12, 04, 14, 11, 18, 13, 07, 10, 05, 09, 15, 08, 14, 16] Write a Python program that allows you to create another list that contains only the marks above the average. If you do not know how to...