20 Mar Wednesday 17:00 Python Practice – 22.03.09.
Question: Use for loop to print the following patterns: a. * ** *** **** b. * *** ***** *** * c. 1010101 10101 101 1 ...
Question: Use for loop to print the following patterns: a. * ** *** **** b. * *** ***** *** * c. 1010101 10101 101 1 ...
Question: Modify the program we made in the class. Create a Boss Class the __init__() method will take three parameters (imgFile, location and speed) the update() method will move the object, if the top of the object reaches the bottom of the screen, it will disappear...
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: Input a string. You must using a stack, reverse the string and print it. Sample Input 1: Enter String to reverse : Apple Sample Output 1 elppA Sample Input 2 Orange Sample Output 2 eganrO...
Question: The factorial function (symbol: !) says to multiply all whole numbers from our chosen number down to 1. Examples: 4! = 4 × 3 × 2 × 1 = 24 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5040 1! = 1 Factorial is not defined for...
Question: Use the recursion we have learn in the class, please try to create a function to recursively calculate the total of 1 + 2 + …. (n-2) + (n-1) + n def total(n): # please write you program below total(int(input('Please enter a number:'))) Class Notes: All...