Computer Science, asked by jasnoorsingh1264, 6 months ago

Make a python command for
A student will not be allowed to sit in exam if his/her attendance is less than 75%.

Take following input from user

Number of classes held

Number of classes attended.

And print

percentage of class attended

Is student is allowed to sit in exam or not.

Answers

Answered by AadilPradhan
1

Python program for a student will not be allowed to sit in exam if his/her attendance is less than 75%.

cls_held = int(input()) #taking number of classes held as input

cls_att = int(input())    #taking number of classes attended as input

#calculating percentage of classes attended

attended = (cls_att/cls_held) * 100

#printing the percentage of classes attended

print("Attandance is",attended)

#checking whether attandance is greater than 75 and printing the same

if attended>75:

   print("Allowed to sit in Exam")

else:

   print("Not allowed to sit in Exam")

#SPJ3

Similar questions