GE3171 – Problem Solving and Python Programming Laboratory Page No:
Ex. No:
Finding Given Year is Leap or Not
Date:
AIM:
To develop a python program to check the given year is leap year or not.
ALGORITHM:
Step 1: Start Process
Step 2: Read year from user input
Step 3: If year is divisible by 4 then goto Step 4 Else goto Step 7
Step 4: If year is divisible by 100 then goto Step 5 Else goto Step 6
Step 5: If year is divisible by 400 then goto Step 6 Else goto Step 7
Step 6: Display “year is a Leap Year” then goto Step 8
Step 7: Display “year is Not Leap Year” then goto Step 8
Step 8: Stop Process
PSEUDOCODE:
START
READ year
IF year%4==0 THEN
IF year%100==0 THEN
IF year==400==0 THEN
DISPLAY year “is a Leap Year”
ELSE
DISPLAY year “is not Leap Year”
ENDIF
ELSE
DISPLAY year “is a Leap Year”
ENDIF
ELSE
DISPLAY year “is not Leap Year”
ENDIF
Name:XXXXXXXXXXXXXXXXXXXXXXXXX Roll Number:23ITXX Branch: [Link]
IT
GE3171 – Problem Solving and Python Programming Laboratory Page No:
FLOW CHART (hand drawing)
Name:XXXXXXXXXXXXXXXXXXXXXXXXX Roll Number:23ITXX Branch: [Link]
IT
GE3171 – Problem Solving and Python Programming Laboratory Page No:
IMPLEMENTATION CODE:
def largest_list(list):
if len(list)!=0:
return max(list)
else:
return -1
list=[]
numbers=int(input("Enter the number"))
for i in range(numbers):
elements=int(input("Enter Elements"))
[Link](elements)
print(list)
p=largest_list(list)
print("The factorial p)
OUTPUT:
Case 1:
Case 2:
Name:XXXXXXXXXXXXXXXXXXXXXXXXX Roll Number:23ITXX Branch: [Link]
IT
GE3171 – Problem Solving and Python Programming Laboratory Page No:
Case 3:
Case 4:
RESULT:
The python program to check the given year is leap year or not has been developed, executed
and tested successfully.
Name:XXXXXXXXXXXXXXXXXXXXXXXXX Roll Number:23ITXX Branch: [Link]
IT