Functions Calling Functions: Review my code, please!


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/1/4?curriculum_id=4f89dab3d788890003000096#


My code is not necessarily wrong, but I want display the proper output of the problem.


def one_good_turn(n):
    return n + 1
    
def deserves_another(n):
    return one_good_turn(n) + 2
    one_good_turn()


#2

What stops you?

How does one display values to the console?


#3

Ionatan,

I just wanted to display my out put but it gives it in hex decimal format. I get how it is structured the only thing I don't get is the current output.


#4

Right now there's no output at all. (note the lack of print statements)

$ cat > yourcode.py
def one_good_turn(n):
    return n + 1
    
def deserves_another(n):
    return one_good_turn(n) + 2
    one_good_turn()
$ python2 yourcode.py 
$

^ Note how the next shell prompt is printed immediately after the command to run your code, with no output from your code coming first


#5

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