Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

grading system in python with nested if

# Write a Python program
# using nested if else statement
# to print the grade based on marks
# input by the user

# Perfect Python Programming Tutorials
# Author : www.EasyCodebook.com (c)

# Actual Program starts here 
# Python Program - Print Your Grade using nested if

marks = input("Enter Marks Obtained: ")
marks = int(marks)
if marks >= 80:
    grade = 'A'
else:
    if marks >= 70:
        grade = 'B'
    else:
        if marks >= 55:
            grade = 'C'
        else:
            if marks >= 50:
                grade = 'Pass'
            else:
                 grade = 'Fail'
print ("
Your Grade is: " + grade)
Comment

PREVIOUS NEXT
Code Example
Python :: pyglet on close 
Python :: precondition error tensorflow predict 
Python :: a.all() numpy 
Python :: Bar Plot Seaborn with No Error Bars 
Python :: flask lazy response style with `make_response` 
Python :: binarizer pyspark 
Python :: get multiples of a number between two numbers python 
Python :: python loop invalid input 
Python :: get false positives from confusoin matrix 
Python :: pyqt5 open tab 
Python :: python if boolean example 
Python :: createdb psql 
Python :: pandas plot column titles vertical 
Python :: how to take multiple input python 
Python :: combining list alternatively 
Python :: telephone number word generator python 
Python :: numpy np sign change in df pandas zero crossing 
Python :: reorder columns in python 
Python :: python reverse words and swap case 
Python :: python numpy bbox 
Python :: pafy python documentation 
Python :: python structure like c 
Python :: pandas read csv read all columns except few columns 
Python :: python tcp 
Python :: if python 
Python :: combine two dataframes of same length 
Python :: python multiprocessing queue 
Python :: dataframe 
Python :: python string caps lock 
Python :: loop python 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =