The working of nested if-else is similar to any other programming language. C, Java, etc
Here you can look at the implementation of it.
age = int(input("Enter age "))
if (age >= 20) and (age <=50) :
print ("Hello adult")
elif age > 50 :
print ("Hello grandpa")
else :
print ("Hello kid")