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 Python Basics (2015) Logic in Python Conditional Value

Carole Cox
Carole Cox
429 Points

It looks right but...?

I've done it again, hit the stupid block. This looks right, I got the first part of the challenge..? No syntax errors and the logic seems OK for the challenge. Help?

conditions.py
admitted = none
if age >=13:
  admitted = "true"
else:
  admitted = "false"
Grigorij Schleifer
Grigorij Schleifer
10,365 Points

And you donΒ΄t need the quotation marks to assign a boolean value like True or False.

You need them for Strings

5 Answers

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi Carole,

try this code:

admitted = None
if age >= 13:
    admitted = True
else:
    admitted = False

True, False and None are uppercased :)

Grigorij

Carole Cox
Carole Cox
429 Points

Thank you! for good practice, I entered both in the challenge. This way it will stick in my brain! I hope to see you in the forum as well! I need to make some Python friends!

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

:))))) Would be nice to share the friendship :))))))

:smiley:

Carole Cox
Carole Cox
429 Points

Thank you Grigori! I knew it had to be something stupid and felt bad to ask such a simple question but I also did not want to stare at it for days while I could be learning more!

I appreciate your help!!

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hey Carole,

there are no stupid questions :) Ask everything you like ... we will help you.

See you in the forum.

G

Carole Cox
Carole Cox
429 Points

Where are you from? Your first name looks Russian or Slavic and your last German. I enjoy meeting people from many cultures.

I really want to learn programming. I wish it was more second nature for me!

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hey,

originally I am from belarus. But now I am living in germany and next week I start a fellowship in Boston, Massachusetts :)))

Where are you from ? Second nature .... this is a nice plan !

Carole Cox
Carole Cox
429 Points

I live in the state of West Virginia, USA. Very rural and mountainous. I am an older learner who tired to learn programming many years ago but let speed bumps and lack of confidence stop me. I won't do that this time.

Best of luck on your fellowship! What is it in?