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

python test paper

The document outlines a series of programming tasks designed to check various conditions and perform calculations. These tasks include checking if a number is positive or negative, determining even or odd status, finding the largest or smallest number among three inputs, and validating leap years and triangle sides. Additional tasks involve grade calculation, temperature checks, and identifying character cases.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

python test paper

The document outlines a series of programming tasks designed to check various conditions and perform calculations. These tasks include checking if a number is positive or negative, determining even or odd status, finding the largest or smallest number among three inputs, and validating leap years and triangle sides. Additional tasks involve grade calculation, temperature checks, and identifying character cases.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

test

1. Check Positive, Negative, or Zero


Write a program to check whether a given number is positive, negative, or zero.

2. Even or Odd Number


Write a program to check whether a number is even or odd.

3. Find the Largest Number


Write a program that takes three numbers as input and prints the largest among
them.

4. Check Leap Year


Write a program to check if a given year is a leap year.

5. Check Vowel or Consonant


Write a program to check whether a given character is a vowel or a consonant.

6. Grade Calculator
Write a program that takes a student's percentage as input and prints the
corresponding grade:
- 90+ → A
- 80-89 → B
- 70-79 → C
- 60-69 → D
- <60 → Fail

7. Check Divisibility
Write a program to check whether a number is divisible by both 5 and 7.

8. Absolute Difference
Write a program that calculates the absolute difference between a number and 21. If
the number is greater than 21, print double the absolute difference.

9. Check Triangle Validity


Write a program to check if three given sides can form a valid triangle. (The sum
of any two sides must be greater than the third side.)

10. Check Alphabet Case


Write a program to check if a given character is uppercase or lowercase.

1. Check for Multiples


Write a program to check whether a given number is a multiple of 3 or 7.

2. Find the Smallest Number


Write a program that takes three numbers as input and prints the smallest among
them.

3. Check Age for Voting


Write a program that checks if a person is eligible to vote (age 18 or above).

4. Check Uppercase or Lowercase


Write a program that checks if an input character is uppercase or lowercase.

5. Identify the Type of Number


Write a program to check whether a given number is positive, negative, or zero.

6. Check for Two-Digit Number


Write a program that checks if a given number is a two-digit number (10 to 99 or -
10 to -99).

7. Find the Middle Number


Write a program that takes three numbers and prints the middle value (not the
highest or lowest).

8. Temperature Check
Write a program that takes a temperature as input and prints:
- "Very Cold" if below 10°C
- "Cold" if 10-20°C
- "Warm" if 21-30°C
- "Hot" if above 30°C

9. Convert Temperature Scale


Write a program that checks whether a user has entered 'C' for Celsius or 'F' for
Fahrenheit and prints a message accordingly.

10. Day of the Week


Write a program that takes a number (1-7) as input and prints the corresponding day
of the week (1 for Monday, 2 for Tuesday, etc.).

You might also like