Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) What would the following function print if 78 is passed as an argument? 1 def get_grade (score) : 2 3 if score > 90:

image text in transcribed
a) What would the following function print if 78 is passed as an argument? 1 def get_grade (score) : 2 3 if score > 90: 4 print('A') 5 if score > 80: 6 print('B') 7 if score > 70: 8 print('C') 9 if score > 50: 10 print('D') 11 else: print('F) 12 b) What would the following function return if 78 passed as an argument? 1 def get_grade (score): 2 3 if score > 90: 4 return 'A' 5 if score > 80: 6 return 'B' 7 if score > 70: return 'C' if score > 50: 10 return 'D' 11 else: 12 return 'F' 13 to co Jo c c) Which code segment would print the expected output? Why? (justify your answer in a short answer only)

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_2

Step: 3

blur-text-image_3

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

Is the market for laptop computers local, national, or global?

Answered: 1 week ago

Question

Define and discuss the process of planned change.

Answered: 1 week ago

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago