0% found this document useful (0 votes)
2 views

G8_Python basics revision - Programming practice#2

The document outlines a series of Python programming exercises aimed at practicing basic concepts. It includes tasks such as converting Celsius to Fahrenheit, calculating quotient and remainder, checking for vowels or consonants, generating multiplication tables, finding factors, summing the first 'n' numbers, and calculating the product of the first 'n' odd numbers. Each task provides input examples and expected output formats.

Uploaded by

mihikapoduval
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

G8_Python basics revision - Programming practice#2

The document outlines a series of Python programming exercises aimed at practicing basic concepts. It includes tasks such as converting Celsius to Fahrenheit, calculating quotient and remainder, checking for vowels or consonants, generating multiplication tables, finding factors, summing the first 'n' numbers, and calculating the product of the first 'n' odd numbers. Each task provides input examples and expected output formats.

Uploaded by

mihikapoduval
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python basics revision - Programming practice#2

1.​ Write a program to convert temperature in celsius to fahrenheit.

​ Formula: F = c * 9/5 + 32
Input:

Enter temperature [in celsius]: 90

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

3.​ Write a Python program to check whether an alphabet is a vowel or consonant.


Input:
Enter a character: a

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

Variation: Print it in the reverse order.


5.​ Write a program that reads a number as input and prints all the factors of the given number
between 1 to 200.
Input:
Type a number: 10

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

You might also like