Question: in python Create a function called searcher that will return True if the integer x exists inside of the list 1 st, and false if
Create a function called searcher that will return True if the integer x exists inside of the list 1 st, and false if it does not. For this problem you cannot use the membership operator in and must solve this using a for-toop. Example 1 Input: Ist =[5,4,2,10],x=10 Output: True Reasion: 10 exists inside of ' ist' Example 2 Input: 1st =[5,4,2,10],x=3 Output: False Reasion: 3 does not exist inside of "Ist" This tests your understanding of: - Variable Assignment - Loops - Conditionals - Functions [] def search(1st, x) : pass II=this should return "True" print (search({5,4,2,10],10))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
