Question: Create a Python program ( final . py ) that includes a function and does the following: Implement a function named process _ list that

Create a Python program (final.py) that includes a function and does the following:
Implement a function named process_list that takes a list and an integer x as input parameters and performs the following operations:
Iterate through each item in the list and for each item:
If the item equals x, print 'found {x}' and exit the loop.
Otherwise, if the item is greater than x, print the item with a suitable message.
Otherwise, print 'lower'.
After exiting the loop, print the value of the last item in the list that was lower than x, with a suitable message. If no such item exists, print a corresponding message.
Define a list of integers list1 as follows:
list1 must contain at least 10 elements, and each element of the list must be an integer. These integers are arbitrary numbers of your choice, but the first element of this list must be a negative integer. For example, [-2,21,99,63,1,16,44,78,20,84,55].
Define an integer variable called mynum and initialize it with the last (rightmost)2 digits of your student ID. Print mynum with a suitable message.
NOTE: You should omit any leading 0s. For example, if the last 2 digits are 05, set mynum as 5.
Call the process_list function in your program with list1 and mynum as arguments.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Finance Questions!