Waht am i doing wrong?


#1

What am I doing wrong?


#2

What error message are you getting?


#3

HI try to remove the " " around true and they should be write with the downcase t


#4

I didn't notice that :slight_smile: Good spot. I just started Python recently, so I am not very good at it.


#5

@netplayer58043 I think I made a mistake too :confused: the true should be write with the uppercase T the same for false like that

True
False

#6

Oh, that's ok, we all make mistakes every once in a while. You were probably confusing it with Java Script or some other language.


#7

Going to try to it out


#8

this is what it said


#9

Is there something wrong with the statements I'm writing for the if, elif and else? everything else looks fine to me


#10

You have two issues with your code. First, you are using the wrong data type. In Python boolean values are represented by integers. 0 is considered to be False, and any other value is considered to be True. This becomes important later on because Python has this concept of "Truthiness" to data types. For now, you don't need to worry about that. Booleans are represented as either True or False.

The data type you are using are strings. Strings are surrounded by quotes: "Example String" or 'Example String'
You are instead using a string with the text True: "True"

Secondly, you are printing instead of returning. What print does is provide output to the console. What return does is provide the given value to the location that invoked its function.

# You can then assign it

result = the_flying_circus()

# Or ignore it

the_flying_circus()

Just for fun, I'm also including an example of the magic behind the curtain:

# Example of Magic behind the curtain

Python 2.7.11 (default, May 15 2016, 09:02:08) 
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 0 == False
True
>>> example = 0
0
>>> not example
True

#11

Will try that out when I'll have the time


#12

You need to return True, not print it. So wherever you have "print", change it to a return statement.


#13

I fixed it!!!:slight_smile: