Posted at 16:49h
in
Uncategorized
by admin
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 belowtotal(int(input('Please enter a number:')))
Class Notes:
All...
Posted at 16:10h
in
Uncategorized
by admin
Question 1.
Use EasyGui to write a program to convert temperatures from Fahrenheit to Celsius. The formula for that is: Celsius = 5 / 9 * (Fahrenheit – 32). Use GUI input and output. You need to create a easygui enterbox to ask Fahrenheit, then use...
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:
Create a loop between 1 to 20.
Print “fizz” if the number is divisible by 3
Print “bizz” if the number is divisible by 5
Print “fizzbizz” if a number is divisible by both 3 and 5.
Otherwise, print the number itself.
...
Posted at 21:36h
in
Uncategorized
by admin
Question:
Continue to program the code we made in the class at the bottom of this page. Try to use for loop to create buttons from 1-9, so the tkinter window would display as below:
for i in range(1, 10): col = ____________ ...
Question:
Continue with the code in the previous class. Add gravity and acceleration into the code as discussed in the previous class. Also, please consider the bottom of the screen as the base. Please use the below image as reference:
...