python-by-phitron

Practice Problems From Day 1 and Day 2

Problem 1 :

Take values of length and breadth of a rectangle from user and check if it is square or not.

Problem 2 :

Take three integer input from user and find the largest number between using if-elif-else statement.

Problem 3:

Write a program using conditional Statement whether a number is even or odd. (even means divisible by 2 and odd mean not divisible by 2) Suppose user provide input as 15 then it will print “15 is an odd number”

Problem 4 :

Write a Program to take integer input from user and display the grade according to the following criteria.

Marks Grade
> 90 A
> 80 and <= 90 B
>= 60 and <= 79 C
below 60 D

Problem 5:

Write a Program to check whether a year is leap year or not. Take input from User.

example: if year = 1996, it is a leap year

Conditions for leap year: