Jump to content

Help with a [super] simple Python homework assignment?

Justin_

Hey guys, I am doing some python for homework and I can't figure out why this code wont work. It looks OK to me, but it is not outputting anything. Think you can offer some help?

year = 1776

if year > 2099:
    print = ('Distant Future')
elif year > 1999:
    print = ('21st century')
elif year > 1899:
    print = ('20th century')
elif year < 1900:
    print = ('Long ago')

 

Capture.PNG

Please "Quote" me if you want me to see your response.

Link to comment
Share on other sites

Link to post
Share on other sites

you don't need '=' signs in the print command. It should be this:

 

year = 1776

if year > 2099:
    print('Distant Future')
elif year > 1999:
    print('21st century')
elif year > 1899:
    print('20th century')
elif year < 1900:
    print('Long ago')
 

Link to comment
Share on other sites

Link to post
Share on other sites

Afaik you don't do

 

print = ("String")

you just do

 

print("String")

 

Want to know which mobo to get?

Spoiler

Choose whatever you need. Any more, you're wasting your money. Any less, and you don't get the features you need.

 

Only you know what you need to do with your computer, so nobody's really qualified to answer this question except for you.

 

chEcK iNsidE sPoilEr fOr a tREat!

Link to comment
Share on other sites

Link to post
Share on other sites

That would be correct, I knew I did something dumb.

Please "Quote" me if you want me to see your response.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×