if statements in Python

Example 1:

name = input("Enter your name: ")
if name:
  print("We know your name.")
Example 2:
friend = "Rolf"
user_name = input("Enter your name: ")
if user_name == friend:
  print("Hello, friend!")
else:
  print("Hello, stranger!")
Example 3:
friends = ["Rolf", "Bob", "Anne"]
family = ["Jen", "Charlie"]
user_name = input("Enter your name: ")
if user_name in friends:
  print("Hello, friend!")
elif user_name in family:
  print("Hello, family!")
else:
  print("Hello, stranger!")