and/or in Python

and
It gives you the first value if it is False, otherwise it gives you the second value

Example:

x = True and False
print(x) # False
x = 3 and 0
print(x) # 0
x = 0 and 3
print(x) # 0


or
Gives you the first value if it is True, otherwise it gives you the second value

Example 1:
x = 3 or 0
print(x) # 3
x = 0 or 3
print(x) # 3

Example 2:
name = "" # can use name = input("Enter your name: ")
surname = "Telinov" # can use surname = input("Enter your surname: ")
greeting = name or f"Mr. {surname}"
print(greeting) # outputs "Mr. Telinov"