Tuesday Python 18:30
Home > Tuesday Python 18:30 (Page 9)
Question 1.
You probably used a for loop in your program in last homework. That’s how most people would do it. But just for practice, try doing the same thing with a while loop.
Sample Input:
Which multiplication table would you like? 5
Sample Output:
Here’s your table:
5 x 1 = 5
5 x...
Question 2:
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 1:
A school has following rules for grading system:
Below 25 - F
25 to 45 - E
46 to 50 - D
51 to 59 - C
61 to 80 - B
Above 80 - A
Write a program to ask user to enter marks...
Question:
A school has following rules for grading system:
Below 25 - F
25 to 45 - E
46 to 50 - D
51 to 59 - C
61 to 80 - B
Above 80 - A
Write a program to ask user to enter marks and...
Question 1:
A store is having a sale. They’re giving 10 percent off purchases of $10 or lower, and 20 percent off purchases of greater than $10. Write a program that asks the purchase price and displays the discount (10% or 20%) and the final price.
Sample Input...
Question 1:
Write a program to use easygui enterbox that asks for your name, then street, then city, then province, then postal code (all in easygui message boxes). The program should then display a mailing-style full address that looks something like this:
Hint:
Do not forget to import easygui in order to...
You can do Question 1~ 3 in Python IDLE:
Question 1.
Use float() to create a number from a string like ‘12.34’. Make sure the result is really a number!
Question 2.
Try using int() to create an integer from a decimal number like 56.78. Did the answer get rounded up...
Notes: It is optional to do the homework form 6 – 8 if you are blow grade 5
Question 1
Make a variable and assign a number to it (any number you like). Then display your variable using print.
Question 2
Modify your variable, either by replacing the old value with a...