Question: Based on the function definition: what would the following two lines of code print? (Note that I have made the function, parameter and variable

Based on the function definition: what would the following two lines of code print? (Note that I have made def my function (numl, num2): if num2 < numl; return -1 else: result - 0 for num in range (numl, num2 + 1):

Based on the function definition: what would the following two lines of code print? (Note that I have made the function, parameter and variable names generic to make the question. challenging. When writing code you intend to actually use, always give such things meaningful names!) print (my_function (10, 5)) print (my_function (5, 10)) def my function (numl, num2): if num2 < numl; return -1 else: result - 0 for num in range (numl, num2 + 1): result result + num return result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The first line print myfunction10 5 will print 1 b... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!