Question: I need some assistance on the following Python question: Complete a if-else statement with multiple branches. If year is 2101 or later, print Distant future

I need some assistance on the following Python question:

Complete a 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

Long ago 

This is what I have so far:

year = int(input())

if year > 2101:

print('Distant future')

elif year >= 2001:

print('21st century')

elif year >= 1901:

print('20th century')

elif year < '1900 or earlier'):

else:

print('Long ago')

I keep getting syntax error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!