Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 6 - Functions - Section 6.4 - Functions with/without Return Values - Check Point - MyProgrammingLab - Page 179: 6.10

Answer

TypeError: '<' not supported between instances of 'tuple' and 'NoneType'

Work Step by Step

In the definition of min function there no return statement hence it return None type object. In the main function the statement min(min(5, 6), (51, 6)) will be reduced to min(None, (51, 6)) after calling the inner min function, then the outer min will be called which will try to compare both arguments one of which is None and other is a tuple and this comparison is invalid due to incompatible types, hence it will give TypeError
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.