FAQ: Learn Python: Functions - Review: Built-In Functions

This community-built FAQ covers the “Review: Built-In Functions” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise Review: Built-In Functions:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

1 Like

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

2 posts were split to a new topic: Why Does This Print Statement Not Execute?

6 posts were split to a new topic: How to Print the Output of a Function?

3 posts were split to a new topic: Why Does This Work With Numbers, But Not Strings?

Hi! I’m on Python (something pretty new for me).

On functions, I’m trying to figure out what “return” does. For example

def biggest_number(*args):
print max(args)
return max(args) -----------> here

What does it do?


have you checked with FAQ:

What does return do?

hi! I’m not sure why this doesn’t work, can anyone tell me?


1 Like


With the code in this exercise, I tried to make the script receive input from the console, but it returns ‘Unicode’ as the type. The function works fine if you pass the argument from code, but do I need to define/transform the raw_input to make it work?

Here is my code:

x = raw_input("Enter a number: ")

print type(1)
print type(1.0)
print type(x)

print distance_from_zero(x)

def distance_from_zero(x):
if type(x) == type(1) or type(x) == type(1.0):
return abs(x)
return “Nope”

print distance_from_zero(-6)
print distance_from_zero(-56.983)
print distance_from_zero(“Abc”)

same problem :confused:

please see this topic:

How to ask good questions (and get good answers)

Asking better questions will get better response.

I guess it was fixed, because it now works two years later.

I’m trying to do something similar, and I think the problem is that raw_input() always outputs a string.
I tried using x = int(rawinput("Enter a number: ") to transform the input to an integer, which works if the user types an integer, but fails if they type a float or a string.

Do you still have a question, or?

Not really, just adding information to @stephenmak5974281141 question.
I assume that if you want to use raw_input() for this exercise, you need to check the input somehow before accepting it to the function?

or you could write a separate function which validates the input.