Please help Can't quite get it


#1


This is the conditionals and control flow exercise, and I'm not entirely sure whether you can place a print function directly after return. If anyone knows please do tell why this isn't working and how to correct it.


def the_flying_circus():
    if 4==4 and 6>=9-3:  
        return  print "now I'm desperate for this to work"
    elif 7==7:
        return print "still confused"
    else:
        return print "whaaa?"


#2

print not need to return
return just used for get back some value but print is an command.
return in functions of python not needed. now you must remove return s


Stuckk on The Big if
#3

@almondcoma In a function, you always need to return, something which you have not done in your "flying_circus" function, however, you do not need to return something in "If, elif, and else" statements. You need to remove the return statements from your if statements, but keep the print statements as they are. Also you need to add a return statement at the end of your function definition, so your code looks like this:

def the_flying_circus():
    if 4==4 and 6>=9-3:  
        print "now I'm desperate for this to work"
    elif 7==7:
        print "still confused"
    else:
        print "whaaa?"
    return True

The instructions told you to return True for this exercise, although what you will return for your function will vary from function to function. Let me know if it still doesn't work after this.

Good luck and happy coding! :slight_smile:

-- @chipjumper36731


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.