Question: This is the task: Write a function to take a list of numbers and a number to check if the number is in the list

This is the task:

Write a function to take a list of numbers and a number to check if the number is in the list or not.

Print out the index of the element, if it exists in the list, and the message 'The element does not exist in the list', otherwise.

This is my code:

This is the task: Write a function to take a list of

How can i change my code to avoid using the list built in functions for finding elements? (This is python coding language)

\#\#Your code here list 1=[1,2,3,5,6,9,12,34,38,45,49] def functionName (x) : result =[] for index in range(len(list 1)) : if x in 1 ist 1 : i= ist 1. index (x) result.append (i) print (result, x ) else: print('The element does not exist in the list') return functionlare (38) [8] 38

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 Databases Questions!