Write a program to check if number is present in the list or not.if the number is present,print the position of the number.Print an appropriate message if the number is not present in the list.
Answers
Answered by
0
list=[2,5,9]
n=int(input("enter number to check"))
if n in list :
position=list.index(n)
print(str(n)+ " is at number " +str(position) + " position" )
else:
print(str(n) + " is not present in the list")
Hope this helps. I have tested this in my pycharm.
Please mark me brainliest bro.
₮Ⱨ₳₦₭ ɎØɄ
Similar questions