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')
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
Related questions
Concept explainers
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
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
- Define the scores for A, B, C, D, and F.
- Set the repeat variable to 'Y'.
- Start a while loop that runs as long as repeat is equal to 'Y'.
- Ask the user to input their test score.
- Use if and elif statements to determine the grade based on the test score.
- If the score is greater than or equal to A_score, print 'Your grade is A.'.
- If the score is greater than or equal to B_score, print 'Your grade is B.'.
- If the score is greater than or equal to C_score, print 'Your grade is C.'.
- If the score is greater than or equal to D_score, print 'Your grade is D.'.
- If the score is less than D_score, print 'Your grade is F.'.
- Ask the user if they want to evaluate another score.
- If the user enters 'Y', repeat the loop. If the user enters 'N', end the loop.
- Print 'The end'.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education