Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

I am not sure what I am doing wrong. Can you please help?

name = input("What should I call you? ")
birth_year = int(input("what year were your born?"))



current_year = 2017

turn_25 = (current_year - birth_year) + current_year 
turn_50 = (current_year - birth_year) + current_year 
turn_75 = (current_year - birth_year) + current_year  
turn_100 = (current_year - birth_year) + current_year

if turn_25 > current year:
    print("You will turn {} in the year {}, {}".format(25, turn_25, name))
if turn_50 > current year:
    print("You will turn {} in the year {}, {}".format(50, turn_50, name))
if turn_75 > current year:
    print("You will turn {} in the year {}, {}".format(75, turn_75, name))
if turn_100 > current year:
    print("You will turn {} in the year {}, {}".format(100, turn_100, name))
else:
    continue

Put the link to the code challenge you are facing problem of.

how do i do that?

Code Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

     ```html
    <p>This is code!</p>
  ```

done.. does that help?

1 Answer

Yea I got it where is your issue -

change the code to-

name = input("What should I call you? ")
birth_year = int(input("what year were your born?"))



current_year = 2017

turn_25 = (current_year - birth_year) + current_year 
turn_50 = (current_year - birth_year) + current_year 
turn_75 = (current_year - birth_year) + current_year  
turn_100 = (current_year - birth_year) + current_year

if turn_25 > current_year:
    print("You will turn {} in the year {}, {}".format(25, turn_25, name))
elif turn_50 > current_year:
    print("You will turn {} in the year {}, {}".format(50, turn_50, name))
elif turn_75 > current_year:
    print("You will turn {} in the year {}, {}".format(75, turn_75, name))
elif turn_100 > current_year:
    print("You will turn {} in the year {}, {}".format(100, turn_100, name))

you got it??

GOOD LUCK!

The challenge is to understand the debugging long term. Especially when there wont be any support.