Generation calculator error

Hello! Happy new year! Can anybody help me fix this code?

birth_year = input("Type your birth year")
birth_year = int(birth_year)

def generation_calculator(birth_year, Generation):
  print(birth_year + Generation)

if birth_year < 1949:
  out = (" - Silent generation")
elif birth_year >= 1949 and <= 1968:
  out = (" - Baby Boomer")
elif birth_year >=1969 and <= 1980:
  out = (" - X generation")
elif birth_year >=1981 and <= 1993:
  out = (" - Millenial")
elif birth_year >=1994:
  out = (" - Z generation")
else:
  out = ("invalid number")

print(birth_year + str(out))

Why the parentheses in out = (" - Silent generation") and the rest? They’re unnecessary.

birth_year >= 1949 and <= 1968 and the rest are syntax errors. They should be either birth_year >= 1949 and birth_year <= 1968 or 1949 <= birth_year <= 1968 and similar.

print(birth_year + str(out)) won’t work because birth_year is an int and str(out) is a string. You can’t add an int and a string. That should be print(str(birth_year) + out). (There’s no point in saying str(out) when out is already a string.)

Thanks! I got it working now. Used if instead of elif, return instead of out, no parenthesis… removed the = signs also… i don´t know why it doesn´t work with this