0% found this document useful (0 votes)
48 views4 pages

Sub PDF

The document contains an evaluation sheet for a Python Programming Lab course, which evaluates a student's ability to apply conditional statements in Python. It includes several programming problems and their solutions testing if/else conditional logic for determining if a number is even or odd, performing basic math operations based on user input, grading student marks, and identifying if a year is a leap year. The student is concluded to have successfully implemented conditional statements to solve the given problems.

Uploaded by

Sanskar Badjatia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views4 pages

Sub PDF

The document contains an evaluation sheet for a Python Programming Lab course, which evaluates a student's ability to apply conditional statements in Python. It includes several programming problems and their solutions testing if/else conditional logic for determining if a number is even or odd, performing basic math operations based on user input, grading student marks, and identifying if a year is a leap year. The student is concluded to have successfully implemented conditional statements to solve the given problems.

Uploaded by

Sanskar Badjatia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BHARTIYA VIDYA BHAVAN’S

SARDAR PATEL INSTITUTE OF TECHNOLOGY


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai – 400058-India

ISE EVALUATION SHEET

CLASS: F.Y. SEM: I BRANCH: __ELECTRONICS_____ ACADEMIC YEAR:2019-20


________
COURSE: Python Programming Lab COURSE CODE: ___________
STUDENT NAME: _________SHUBHAM HULE_____ ROLL NO:17
___________________

Aim TO APPLY CONDITIONAL STATEMENTS IN PYTHON

Problem
Statement Identifying whether a number is odd or even

Program
a=int(input("enter the number"))
if a%2==0:
print("number is even")
else:
print("number is odd")

output
enter the number8
number is even
enter the number5
number is odd

Problem
Statement Basic calculator(add, subtract,multiply,divide)

Program
a=int(input('enter a number'))
b=int(input('enter a number'))
print("1 is for adition, 2 is for subtraction,3 is for multiplication,4 is for
division")
select=int(input("please enter a corresponding number for performing an
operation"))
if select==1:
c=a+b
print(c)
elif select==2:
d=a-b
print(d)
elif select==3:
e=a*b
print(e)
elif select==4:
f=a/b
print(f)
else:
print("enter a valid number")

Output
enter a number2
enter a number3
1 is for adition, 2 is for subtraction,3 is for multiplication,4 is for division
please enter a corresponding number for performing an operation1
5
enter a number3
enter a number7
1 is for adition, 2 is for subtraction,3 is for multiplication,4 is for division
please enter a corresponding number for performing an operation2
-4
enter a number6
enter a number8
1 is for adition, 2 is for subtraction,3 is for multiplication,4 is for division
please enter a corresponding number for performing an operation3
48
enter a number7
enter a number2
1 is for adition, 2 is for subtraction,3 is for multiplication,4 is for division
please enter a corresponding number for performing an operation4
3.5

Problem
Statement
Printing the grade of the students when the marks are input

Program
a=int(input("enter the marks"))
if a>=90:
print("A grade")
elif 90>a>=80:
print("B grade")
elif 80>a>=60:
print("C grade")
elif 60>a>=40:
print("D grade")
else:
print("failed")

Output
enter the marks92
A grade
enter the marks80
B grade
enter the marks52
D grade
enter the marks63
C grade
enter the marks35
failed

Problem
Statement Finding whether a given year is leap or not

Program
year = int(input("Enter a year"))

if (year % 4) ==0:
if (year % 100) == 0:
if (year % 400) == 0:
print("year is a leap year")
else:
print("year is not a leap year")
else:
print("year is a leap year")
else:
print("year is not a leap year")

Output
enter the year2019
year is not a leap year
Enter a year2000
year is a leap year
Enter a year1400
year is not a leap year

Conclusion I have implemented the use of conditional statements for the above given
programs

You might also like