Exercise 7 Write a complete Python program including minimal comments (file name
ID: 3669299 • Letter: E
Question
Exercise 7 Write a complete Python program including minimal comments (file name, your name, and problem description) that solves the following problem with the main function: This will be the extension to Exercise 3 and solving the same problem as Exercise 5 using a multi-way if statement (if-elif-else). Copy the program for Exercise 3 as Exercise 7 using the command below, then start from there cp exercise7p3.py exercise7p7.py Problem Specification: Write a program that asks the user for a score which ranges between 0 and 100 inclusive. If the score is with in the valid range, the program should check for standing: 1. . Good if the score is 73 or higher Pass if the score is 60 or higher but lower than 73 . Fail if the score is below 60. Your program should print a message if the number is invalid as shown in the sample runs. You program should display an appropriate input prompt as shown in the sample runs. sample run #1: Enter a score (o to 10o): 60 60 is Pass. Sample run #2: Enter a score (0 to 100)110 10 is an invalid number The number should be between o and 100 inclusive sample run #3: Enter a score (o to 100) 100 is Good 100 sample run #4 Enter a ore (o to 100) 110Explanation / Answer
This below python code will work as specified in problem statement i.e deciding grade value based on the input accept from console..see the below code for get the grade..
input = raw_input("Enter a Score (0 to 100):")
if ( input > 0 and input <= 100):
if ( input>=73):
print input+" is Good"
elif (input >=60 and input <73):
print input+" is Pass"
else:
print input+" is Fail"
else:
print input+" is an invalid number The Number should be between 0 and 100 inclusive"
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.