Hello everyone, welcome to nkcoderz.com. In this article we will going to discuss about Python program to display marks cadre.
Here is a Python program that will determine and display the marks cadre of a student based on their marks:
Program to display marks cadre
Table of Contents
Code for python program to display marks cadre
# Get the student's marks
marks = float(input("Enter your marks: "))
# Determine and display the marks cadre
if marks >= 90:
print("Your marks cadre is A+.")
elif marks >= 80:
print("Your marks cadre is A.")
elif marks >= 70:
print("Your marks cadre is B+.")
elif marks >= 60:
print("Your marks cadre is B.")
elif marks >= 50:
print("Your marks cadre is C+.")
elif marks >= 40:
print("Your marks cadre is C.")
else:
print("Your marks cadre is D.")
Output
Enter your marks:
90
Your marks cadre is A+.
Explanation
This program first gets the student’s marks by prompting the user to enter their marks and then converting the entered marks to a float. It then uses a series of if
and elif
statements to check the marks and determine the marks cadre.
If the marks are greater than or equal to 90, the program prints “Your marks cadre is A+.” If the marks are greater than or equal to 80 but less than 90, the program prints “Your marks cadre is A.” and so on. If the marks are less than 40, the program prints “Your marks cadre is D.”
Python program to print eligibility to vote
Conclusion
If you liked this post ‘Python program to display marks cadre‘, then please share this with your friends and make sure to bookmark this website for more awesome content.