Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Program to illustrate the use of nested if statement Average in python Grade >=80 and above A >=70 and <80 B >=60 and <70 C >=50 and <60 D Otherwise

sub1=int(input("Enter marks of the first subject: "))
sub2=int(input("Enter marks of the second subject: "))
sub3=int(input("Enter marks of the third subject: "))
sub4=int(input("Enter marks of the fourth subject: "))
sub5=int(input("Enter marks of the fifth subject: "))
avg=(sub1+sub2+sub3+sub4+sub4)/5
if(avg>=80&avg<90):
    print("Grade: A")
elif(avg>=70&avg<80):
    print("Grade: B")
elif(avg>=60&avg<70):
    print("Grade: c")
elif(avg>=50&avg<60):
  print("grade: D")
else:
    print("Grade: e")
Comment

PREVIOUS NEXT
Code Example
Python :: scipy kullbach leibler divergence 
Python :: sourcetrail index library python 
Python :: NumPy bitwise_xor Code When inputs are numbers 
Python :: NumPy left_shift Code When inputs and bit shift are an arrays 
Python :: Convertion of an array into binary using NumPy binary_repr 
Python :: django view - mixins and GenericAPIView (list or create - GET, POST) 
Python :: Break up long line of code to span over several lines 
Python :: qlcdnumber set value 
Python :: discord python bot input 
Python :: downgrading to previous migration django 
Python :: tkintre sub windows 
Python :: LCS Problem Python 
Python :: how to process numerical data machine learning 
Python :: How can I make portable python desktop application 
Python :: List change after copy Python 
Python :: combobox write disable tkinter 
Python :: lmplot color] 
Python :: how to plot graph between f1 score and random forest parameters 
Python :: how to seperate the script from html template when using jQuery in flask 
Python :: Express + Jade : Ensuring url paths are correct via controllers, orphaned links 
Python :: np sign no 0 
Python :: ring For in Loop 
Python :: negative max in python 
Python :: echo linux with ANSI escape sequence for change output color 
Python :: dateentry python centered 
Python :: fibonacci sphere python 
Python :: custom 3d image generator for segmentation 
Python :: how to update sheety 
Python :: plot true values vs actucal vales 
Python :: jupyter notebook save as python script without terminal prompts line numbers 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =