12 Mar PMCA Sunday 16:00 Python Homework 20.03.08.
Question: Complete the code we did for a simple calculator. Add the button to do subtraction, division and find the exponent for num1^num2...
Question: Complete the code we did for a simple calculator. Add the button to do subtraction, division and find the exponent for num1^num2...
Question: Create the following * pattern image base on your input Hint: Remember when we multiply a string by a number, the string is repeated the number times. >>> '*' * 10 '**********' Also you would need 2 for loops to solve the question Sample Input 1: 3 Sample Output 1: *** ** * * ** *** Sample Input 2: 5 Sample Output...
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: Write a method that reads in three angles (in degrees). State the type of the triangle based on the conditions below: If all three angles are 60, output Equilateral. If the three angles add up to 180 and exactly two of the angles are the...
Question: You have come up with the following compression technique: for each symbol, write down the number of times it appears consecutively, followed by the symbol itself. This compression technique is called run-length encoding. Given a sequence of characters, write a program to encode them in this...
Question: Create the following * pattern image base on your input Hint: Remember when we multiply a string by a number, the string is repeated the number times. >>> '*' * 10 '**********' Also you would need 2 for loops to solve the question Sample Input 1: 3 Sample Output 1: *** ** * * ** *** Sample Input 2: 5 Sample Output...
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...
Question: Use TKinter to create 6 buttons as following picture: ...
Question: You’re on a long car trip and arrive at a gas station. It’s 200 km to the next station. Write a program to figure out if you need to buy gas here, or if you can wait for the next station. Input Specification: The program should ask the question,...
Question: Create the following * pattern image base on your input Sample Input 1: 3 Sample Output 1: * ** *** *** ** * Sample Input 2: 5 Sample Output 2: * ** *** **** ***** ***** **** *** ** *...