Question

Write a Python Program Display the grades: Input: Enter the marks of the student Condition: Grade...

Write a Python Program

Display the grades:

Input:

Enter the marks of the student

Condition:

Grade A: Marks greater than 90

Grade B: Marks range from 81 to 90

Grade C: Marks range from 65 to 80

Fail: less than 65

Display the output.

Example:

  1. Input: 95

Display: “student got Grade A”

  1. Input: 80

Display: “student got Grade C”

  1. Input: 64

Display: “student failed”

Hint: Use else if (elif and logical operators)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
marks = int(input("Enter score: "))

if marks > 90:
    print("student got Grade A")
elif marks > 80:
    print("student got Grade B")
elif marks >= 65:
    print("student got Grade C")
else:
    print("student failed")

Add a comment
Know the answer?
Add Answer to:
Write a Python Program Display the grades: Input: Enter the marks of the student Condition: Grade...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ program that computes student grades for an assignment as a percentage given each...

    Write a C++ program that computes student grades for an assignment as a percentage given each student's score and the total points. The final score must be rounded up to the nearest whole value using the ceil function in the <cmath header file and displayed as a percentage. You must also display the floating-point result up to 5 decimal places. You must use at least 2 functions: one to print the last name of the student and another function to...

  • Microsoft Visual Studios 2017 Write a C++ program that computes a student’s grade for an assignment...

    Microsoft Visual Studios 2017 Write a C++ program that computes a student’s grade for an assignment as a percentage given the student’s score and total points. The final score must be rounded up to the nearest whole value using the ceil function in the <cmath> header file. You must also display the floating-point result up to 5 decimal places. The input to the program must come from a file containing a single line with the score and total separated by...

  • write a program that uses a function to read in the grades for four classes and...

    write a program that uses a function to read in the grades for four classes and then uses a function to calculate the average grade in each of the classes. input the grades for one student. we will name her Beverly. output how Beverly's grade differs from each classe average. Make sure that your output is very clear. Below is your data: English 90 70 85 45 95 95 82 97 99 65 History 63 94 60 76 83 98...

  • ### Question in python code, write the code on the following program: def minmaxgrades(grades, names): """...

    ### Question in python code, write the code on the following program: def minmaxgrades(grades, names): """ Computes the minimum and maximujm grades from grades and creates a list of two student names: first name is the student with minimum grade and second name is the student with the maximum grade. grades: list of non-negative integers names: list of strings Returns: list of two strings """ def main(): """ Test cases for minmaxgrades() function """ input1 = [80, 75, 90, 85,...

  • Write down a Cre program on computer that calculates the grades of the stud f the...

    Write down a Cre program on computer that calculates the grades of the stud f the students for the marks by using "if else statements "for the following conditions. Marks 60 Grade "D" Marks > 60 &&70 Grade "C" Marks > 70 &&80 Grade "B" Marks > 80 && 90 Grade "A" Marks> 90 && -100 Grade "A+"

  • Please provide pseudocode for the following python program: class Student: def t(self,m1, m2, m3): tot= m1+m2+m3;...

    Please provide pseudocode for the following python program: class Student: def t(self,m1, m2, m3): tot= m1+m2+m3; average = tot/3; return average class Grade(Student): def gr(self,av): if av>90: print('A grade') elif (av<90) and (av>70): print('B grade') elif (av<70) and (av>50): print('C grade') else: print('No grade') print ("Grade System!\n") s=Student(); repeat='y' while repeat=='y': a=int(input('Enter 1st subject Grade:')) b=int(input('Enter 2nd subject Grade:')) c=int(input('Enter 3rd subject Grade:')) aver=s.t(a,b,c); g=Grade(); g.gr(aver); repeat=input("Do you want to repeat y/n=")

  • Write a program to calculate students’ average test scores and their grades. You may assume the...

    Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...

  • Write a program to calculate students’ average test scores and their grades. You may assume the...

    Write a program to calculate students’ average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three...

  • this code is not working for me.. if enter 100 it is not showing the grades...

    this code is not working for me.. if enter 100 it is not showing the grades insted asking for score again.. #Python program that prompts user to enter the valuesof grddes . Then calculate the total scores , #then find average of total score. Then find the letter grade of the average score. Display the #results on python console. #grades.py def main(): #declare a list to store grade values grades=[] repeat=True #Set variables to zero total=0 counter=0 average=0 gradeLetter='' #Repeat...

  • In python language please! -Include your Python codes and outputs (a) Write a python program which...

    In python language please! -Include your Python codes and outputs (a) Write a python program which first gets two integers a and b from the user, and then by using an if-elif-else structure, display either ("b is greater than a"), ("a is greater than b"), or ("b is equal to a") (b) use a while loop to determine and print the squares of all integers from 1 to 10

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT