Answer to Question #294408 in Python for saurabh

Question #294408

size1 and size2 are the sizes of two files, and space is the amount of available space on a flash drive. Write a function that takes these integer numbers as arguments and figures out the largest combination of files that fits on a flash drive. The method should return 3 if both files fit together, the file number (1 or 2) corresponding to the longest file that fits by itself (1 if the files are the same size), or 0 if neither file fits on the flash drive.

Your function must have only one return statement.


1
Expert's answer
2022-02-06T07:08:36-0500
def maximum(a, b, c):


	if (a >= b) and (a >= c):
		largest = a


	elif (b >= a) and (b >= c):
		largest = b
	else:
		largest = c
		
	return largest

a = 10
b = 14
c = 12
print(maximum(a, b, c))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS