Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#phyton ''' Please help me to solve this error. Error: Traceback (most recent call last): File /Users/mdhossain/Desktop/p4.py, line 91, in main() File /Users/mdhossain/Desktop/p4.py, line 83,

#phyton

''' Please help me to solve this error. Error: Traceback (most recent call last): File "/Users/mdhossain/Desktop/p4.py", line 91, in main() File "/Users/mdhossain/Desktop/p4.py", line 83, in main (x, y, z) = get_scores() TypeError: cannot unpack non-iterable NoneType object ''' # Please do not use append & tuple

def get_scores():

#Ask user to input x = int(input('Enter 1st posative number: ')) #check valid number while x < 0: print('invalid input! Must be posative') x = int(input('Enter 1st posative number: ')) break

#Ask user to input y = int(input('Enter 3rd posative number: ')) #check valid number while y < 0: print('invalid input! Must be posative') y = int(input('Enter 1st posative number: ')) break

#Ask user to input z = int(input('Enter 3ed posative number: ')) #check valid number while z < 0: print('invalid input! Must be posative') z = int(input('Enter 3rd posative number: ')) # it will return xyz return x, y, z break

def calculate_average(score1, score2, score3):

#get avg value return (score1 + score2 + score3) / 3

#grade

def assign_grade(score):

if (score >= 90):

return 'A'

elif (score >= 80 and score < 90):

return 'B'

elif (score >= 70 and score < 80):

return 'C'

elif (score >= 60 and score < 70):

return 'D'

else:

return 'F'

def show_results(num, letterGrade):

print("Average score:", num)

print("Assigned letter grade:", letterGrade)

def main():

(x, y, z) = get_scores()

avgScore = calculate_average(score1, score2, score3)

letterGrade = assign_grade(avgScore)

show_results(avgScore, letterGrade)

main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Have issues been prioritized?

Answered: 1 week ago

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago