calthoff / self_taught

This repository contains the exercises for "The Self-Taught Programmer: The Definitive Guide to Programming Professionally."
http://theselftaughtprogrammer.io
267 stars 226 forks source link

Console prints 4 instead of nothing #12

Closed Xeyro closed 6 years ago

Xeyro commented 6 years ago

This example says that the console doesn't print anything. But if I input

f(2)

into the console, it prints 4. I'm not understanding what I'm doing differently if the console shouldn't be returning a result.

Xeyro commented 6 years ago

Leaving this for a record of my own shame. I was using the shell directly instead of using a .py file which the book specifically states will provide a different result specifically to the print function.