For some reason it just jumps to the else statement instead of going to if and elif.
Any input would really be apreciated.

a=raw_input( "What is your name: ")
b= int(raw_input( "What year were you born: "))
c= int(raw_input( "What year is it now: "))
print "Hello",a,"you are",c-b,"years old."
class object():
    'userAge'== c-b
    'teenager'== (13,14,15,16,17,18,19)
    if 'userAge' <=12:
         print "You are really young"
    elif 'userAge'=='teenager':
         print "You are a teen"
    else:
         print "You're really old."
         
         
object()

Recommended Answers

All 4 Replies

Your syntax is just wrong in so many ways. Please visit the Python Tutorials or read the introduction to your Python book again.

Line 6: False value never used
Line 7: Always False value not used
Why you are using class instead of funtion?

For some reason it just jumps to the else statement instead of going to if and elif.
Any input would really be apreciated.

a=raw_input( "What is your name: ")
b= int(raw_input( "What year were you born: "))
c= int(raw_input( "What year is it now: "))
print "Hello",a,"you are",c-b,"years old."
class object():
    'userAge'== c-b
    'teenager'== (13,14,15,16,17,18,19)
    if 'userAge' <=12:
         print "You are really young"
    elif 'userAge'=='teenager':
         print "You are a teen"
    else:
         print "You're really old."
         
         
object()

You just need to take your time and learn python. Read pybooks and practice a lot

commented: agree +8

Sorry for wasting your time. Thanks for posting and yes im new lol.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.