Practical no 4 : Write simple python program to
demonstrate use of conditional statements : if
statement , “if -else” statement , nested “if “
statement.
Q1) Write a program to check whether a number is even
or odd.
Output:
Q2) write a program to find out absolute value of an
input number.
Output:
Q3)Write a program to check the largest number among
three numbers.
Output:
Q4)W rite a program to check if the input year is a leap
year or not
Output:
Q5) Write a program to check if a number is
positive ,negative or zero.
Output:
Q6) Write a program that takes the marks of 5 subjects
and displays the grade.
Output: