{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midtermtwo2013key

# 1 101 99 b what is printed at checkpoint 2 1 99 101

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sorted list tmp = max(x, y) x = min(x, y) y = tmp print(x, y, z) # checkpoint 1 tmp = max(y, z) y = min(y, z) z = tmp print(x, y, z) # checkpoint 2 tmp = max(x,y) x = min(x,y) y = tmp print(x, y, z) # final checkpoint After entering the following into the Python Shell: >>> result = sort3(101, 1, 99) a) What is printed at checkpoint 1? 1 101 99 b) What is printed at checkpoint 2? 1 99 101 c) What is printed at the final checkpoint? 1 99 101 d) What is the value of result? (1) None (2) 1 (3) 99 (4) ‘result’ (5) Given the following Python code: def greeting(name): ''' What does this function do? ''' return('Hello, ' + name) (a) Write the docstring for greeting: ‘’’Returns a personal greeting: Hello, <input name&...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online