0

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()
4
Contributors
4
Replies
7
Views
5 Years
Discussion Span
Last Post by South
Featured Replies
  • Your syntax is just wrong in so many ways. Please visit the [URL="http://docs.python.org/tutorial/index.html"]Python Tutorials[/URL] or read the introduction to your Python book again. Read More

  • 1

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

  • [QUOTE=South;1536528]For some reason it just jumps to the else statement instead of going to if and elif. Any input would really be apreciated. [CODE]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 … Read More

1

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

2

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

Comments
agree
0

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

This question has already been answered. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.