Write an if-else statement with multiple branches.
If year is 2101 or later, print "Distant future" (without quotes). Otherwise, if year is 2001 or greater, print "21st century". Otherwise, if year is 1901 or greater, print "20th century". Else (1900 or earlier), print "Long ago".

Sample output with input: 1776

What am I doing wrong here!!!!!!
I've tried it with =>
and just >

It isn't running the final submission

Testing with input: 1901
Output differs. See highlights below.
Your output
Long ago
Expected output
20th century

Write an ifelse statement with multiple branches If year is 2101 or later print Distant future without quotes Otherwise if year is 2001 or greater print 21st ce class=

Respuesta :

Answer:

This program is written in python. The complete code with detail description is given below in explanation section.

Explanation:

year = int(input("Enter Year:"))

if year > 2101:

   print("Future Distant")

elif year > 2001:

   print("21st Century")

elif year > 1901:

   print("20th Century")

elif year <1900:

   print("Long Ago")

else:

   print("No data exist for that year")

.......................................................................................................................

this code run successfully according to requirement as asked in question.

Answer:

Code below

Explanation:

year = int(input())

if year >= ( 2101):

  print("Distant future")

elif year >= (2001):

  print("21st century")

elif year >= (1901):

   print("20th century")

elif year <= (1900):

  print("Long ago")

else:

  print("No data exist for that year")