My code has many errors and I can't figure them out. It is in Python.   # Define grades   A_score = 90 B_score = 80 C-score = 70   repeat == 'Y'   while repeat = 'Y':          # Have the user input their test scores          score = int(input('Enter your test score: '))       # Create if and else statements for test scores          if score <= A_score:         print('Your grade is A.')     else:         if score >= B_score:             print('Your grade is B.')         else             if score >= C_score:                 print('Your grade is C.')             else:                 if score >= D_score:                     print('Your grade is D.')                 else:                     print('Your grade is F.)       # Have user enter if they want to input another score                                again = input('Would you you like to evaluate another score? (Y or N)')   print('The end')

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
My code has many errors and I can't figure them out. It is in Python.
 
# Define grades
 
A_score = 90
B_score = 80
C-score = 70
 
repeat == 'Y'
 
while repeat = 'Y':
    
    # Have the user input their test scores
    
    score = int(input('Enter your test score: '))
 
    # Create if and else statements for test scores
    
    if score <= A_score:
        print('Your grade is A.')
    else:
        if score >= B_score:
            print('Your grade is B.')
        else
            if score >= C_score:
                print('Your grade is C.')
            else:
                if score >= D_score:
                    print('Your grade is D.')
                else:
                    print('Your grade is F.)
 
    # Have user enter if they want to input another score
                          
    again = input('Would you you like to evaluate another score? (Y or N)')
 
print('The end')
Expert Solution
Step 1: Providing the algorithm
  1. Define the scores for A, B, C, D, and F.
  2. Set the repeat variable to 'Y'.
  3. Start a while loop that runs as long as repeat is equal to 'Y'.
  4. Ask the user to input their test score.
  5. Use if and elif statements to determine the grade based on the test score.
  6. If the score is greater than or equal to A_score, print 'Your grade is A.'.
  7. If the score is greater than or equal to B_score, print 'Your grade is B.'.
  8. If the score is greater than or equal to C_score, print 'Your grade is C.'.
  9. If the score is greater than or equal to D_score, print 'Your grade is D.'.
  10. If the score is less than D_score, print 'Your grade is F.'.
  11. Ask the user if they want to evaluate another score.
  12. If the user enters 'Y', repeat the loop. If the user enters 'N', end the loop.
  13. Print 'The end'.
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education