Suppose,we have to find that user exists in website or not. so most basic method is check new user by every exist user ,name by name.
But if there are millions of users in website . So,it will take to much time so in this condition we , can use if – else statement.
- If user exist it will display statement , user exist in website.
- else it will print user not exist in website.
Website = [“aman”,”ragay”,”john”,”sarah”, “edward”,”rose”]
if “sarah” in Website:
print(“user is exist in website! “)
else:
print(“user is not in website !”)