G8_Python basics revision - Programming practice#2
G8_Python basics revision - Programming practice#2
Formula: F = c * 9/5 + 32
Input:
Output:
90C = 134F
2. Write a program to take two numbers as input and print the quotient and remainder.
Input:
Enter dividend: 13
Enter divisor: 3
Output:
Quotient: 3
Remainder: 1
Output:
The character is a vowel.
Input:
Enter a character: x
Output:
The character is a consonant.
4. Write a program that reads a number as input and prints the multiplication table from 1 to ‘10’.
Input:
Type a number: 5
Output:
5 * 1 = 5
5 * 2 = 10
.
.
5 * 10 = 50
Output:
10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 200
6. Write a program that reads a number as input and finds the sum of first ‘n’ numbers.
Input:
Type a number: 5
Output:
1 + 2 + 3 + 4 + 5 = 15
Input:
Type a number: 10
Output:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
7. Write a program that finds the product of the first ‘n’ odd numbers. (using while-loop)
Input:
Type a number: 5
Output:
1 * 3 * 5 = 15
Input:
Type a number: 7
Output:
1 * 3 * 5 * 7 = 105