#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()

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

#phyton

''' Please help me to solve this error.
Error:
Traceback (most recent call last):
File "/Users/mdhossain/Desktop/p4.py", line 91, in <module>
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()

Exper

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY