12/15 I'm not sure what I'm doing wrong in this


#1

def using_control_once():
if 2 == 2
return "Success #1"

def using_control_again():
if 3 == 3
return "Success #2"

print using_control_once()
print using_control_again()


#2

Without indentation, it is hard for us to see where the error might be. I do notice a couple of things, though:

if 2 == 2
# and
if 3 == 3

Both those lines should have a colon at the end:

if 2 == 2:
if 3 == 3:

#3

```

def using_control_once():
    if 2 == 2:
        return "Success #1"

def using_control_again():
    if 3 == 3:
        return "Success #2"

print using_control_once()
print using_control_again()

```

The above demonstrates how enclosing your code sample between three back ticks will preserve the formatting from your editor.


#4

you forgot to indent the "return statements" always indent the return statements to the first tab from an automatically created pipe. Also, if statement is to be intented towards the pipe.


#5

Adding the semi colon really helped, thank you so much guys. Also I didn't' realize that it wouldn't come out indented when i uploaded the question, sorry about that confusion.


#6

The real problem with not posting formatted code samples, especially in the case of Python where they are so much a part of the syntax, is that we cannot see the indents, and often the replies will center around that, rather than what the actual error may be.

Using backticks to format your code