0% found this document useful (0 votes)
15 views1 page

Practice

The document contains two Python programs: one for determining a student's grade based on their percentage and another for checking if a number is positive, negative, or zero. The grade program uses conditional statements to classify the percentage into grades A, B, C, D, or E. The second program similarly uses conditions to classify the input number as positive, negative, or zero.

Uploaded by

afbbscomplab
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)
15 views1 page

Practice

The document contains two Python programs: one for determining a student's grade based on their percentage and another for checking if a number is positive, negative, or zero. The grade program uses conditional statements to classify the percentage into grades A, B, C, D, or E. The second program similarly uses conditions to classify the input number as positive, negative, or zero.

Uploaded by

afbbscomplab
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/ 1

INPUT OUTPUT

#PROGRAM TO FIND GRADE enter your percentage87


per=int(input("enter your percentage")) you have A grade
if(per>85):
print ("you have A grade") enter your percentage 34
elif(per>70 and per<85): you have E grade
print("you have B grade")
elif(per>60 and per<70): enter your percentage 67
print ("you have C grade") you have C grade
elif(per>=45 and per<60):
print ("you have D grade") enter your percentage45
else: you have D grade
print("you have E grade")

#PROGRAM TO CHECK IF NO. IS +VE, -VE OR 0 enter a number6


num=int(input("enter a number")) it is a posi ve integer
if (num>0):
print("it is a posi ve integer") enter a number-4
elif(num<0): it is a nega ve integer
print("it is a nega ve integer")
else:
print ("the no. is zero")

You might also like