Learn practical skills, build real-world projects, and advance your career
!pip install jovian --upgrade --quiet
import jovian

Question 1: The user will enter a list of numbers and a separate number. The program will display the index at which the number is present in the list. If the number is absent, it'll return -1. Do NOT use built-in functions for searching.

no_elements=int(input('Enter number of elements in the list '))
user_list=[]
for i in range(no_elements):
    num=int(input('Enter the '+str(i+1)+' th number'))
    user_list.append(num)
print('The list created by the user is', user_list)
user_input = int(input('Enter another number:' ))
if user_input in user_list:
    print('Index of the number is:', user_list.index(user_input))
else:
    print(-1)    

Question 2: The user will enter a list of numbers the program should return the third largest number. Do NOT sort the list. Your program should display 0 if the list has insufficient numbers.