pythonCopy code
if condition:
# code to execute if condition is True
elif another_condition:
# code to execute if another_condition is True
else:
# code to execute if none of the above conditions are True
pythonCopy code
age = 25
if age < 13:
print("Child")
elif age < 18:
print("Teenager")
elif age < 60:
print("Adult")
else:
print("Senior")
Copy code
Adult
pythonCopy code
def month_name(month):
pythonCopy code
months = {
1: "January",
2: "February",
3: "March",
}
pythonCopy code
return months.get(month, "Invalid month")