+ 1
How to get confirmation if the input is in a list?
i try to make a list from 0-50, and I try to add the input, and if the input number is in the list, want it to print something, else to print something different. Can anybody offer some code samples?
1 Réponse
+ 2
List=list(range(0,51))
inp = int(input("Enter a number"))
if inp in List:
print("Already in List ")
else:
print("Not in List")