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 finalpy that includes a function and does the following:
Implement a function named processlist 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 list as follows:
list must contain at least 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,
Define an integer variable called mynum and initialize it with the last rightmost digits of your student ID Print mynum with a suitable message.
NOTE: You should omit any leading s For example, if the last digits are set mynum as
Call the processlist function in your program with list and mynum as arguments.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
