Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![James Estrada](https://uploads.teamtreehouse.com/production/profile-photos/18720/micro_Screen_Shot_2018-02-22_at_12.15.13_AM.jpg)
James Estrada
Full Stack JavaScript Techdegree Student 25,866 PointsWhy are we returning None at the end of the function?
Doesn't Python return None by default if no return statement was given?
1 Answer
![Moosa Bonomali](https://secure.gravatar.com/avatar/954a74b4a976abb304f9329ac4f20009?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Moosa Bonomali
6,297 PointsIt is true that If the function does not return a, then if you read that function into a variable, you will get a None if the function did not return a value. However when taking into account the PEP8 Standard, which provides styling guidelines to make code more readable and more understandable, then according to the PEP8 standard;
Be consistent in return statements. Either all return statements in a function should return an expression, or none of them should. If any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable).