Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

det add three(x,y.z) (a) 12345674512378 b) 1234567451235678 (c) 1474512378 (d) 147451235678 (e) 745612378 return t #line 2 def tises three(u): p-add-three(u,v,v) return P #line 4

image text in transcribed
det add three(x,y.z) (a) 12345674512378 b) 1234567451235678 (c) 1474512378 (d) 147451235678 (e) 745612378 return t #line 2 def tises three(u): p-add-three(u,v,v) return P #line 4 #iines #line 6 result-times-three (2) print(result) #1 ine 7 #line 8 7. What does the following code fragment print? import math def size format2(b): (a) 2.0B (b) 2.0KB (c) 20.OKE (d) 20.044KB u -int min (math.floor( math.log(b, 1000), 4)) (e) 20.044M return str(b/(1000u))units[u) print (size format2(20044)) 8. Similarly to what you needed to do in Assignment 3, imagine you have to ask the player to answer "yes" or "no" or "maybe" to indicated their desired choice. The game needed to repeated that question until "yes" or "no" or "maybe" is entered. The following code fragment is missing a line of code. Which of the options solves the problem correctly? choice-input ("Please ansver vith Yes or No or Maybe: ").strip).lover ) # MISSING LINE OF CODE print(choice, "is not existing option. Please try again.) choice-input ("Please answer vith Yes or No or Maybe: ").strip.loverO (a) while choice!-"yes" or choice! "no" or choice!-"saybe" (b) while choice!-"yes" and choice!-"no" and choice!-"naybe" (c) while choices"yes" or choiceno" or choices"maybe": (d) while choice in ["yes", "no", "maybe"]: (e) More than one of the above answers is correct. 9. Consider the following code: (a) the pair (8, 16) (b) the pair (8, 272) (c) the pair (8, 0) (d) the pair (8.5, 16) (e) the pair (8.5, 272) def banana (p): return (p//2, (p1)16) Calling banana (17) will return: the following lines of two lines of code should replace #line A and line B such that the function correctly solves the problem described in the docstrings. 10. The following function is missing two lines of code indicated by #line A and line B. Which of

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

Students also viewed these Databases questions

Question

=+Are they specific or general in nature?

Answered: 1 week ago

Question

=+ What is the nature of the contracts or agreements with unions?

Answered: 1 week ago

Question

=+What is the procedure for labor relations in the workplace?

Answered: 1 week ago