Lesson 3
Discovering your Paths
Chapter 7: Using existing functions
Built-in functions
Python provides many built-in functions. We have already used a few of these:
abs()
input()
print()
Now, here are some questions to help you figure out how to use some of the other built-in functions provided by Python.
You can find the complete list of built-in functions in the official documentation. The answers to the questions below can all be found on this page.
Some of the functions on the page will not make sense yet, so don’t worry. You should be able to understand them better once we have covered more topics. For now, try to find the ones you need to answer the questions below (you should be able to understand these).
Also try to see whether you can understand the documentation. You will need to know how to read and understand documentations to be able to program well, especially when you start writing more complex programs in the future.
For the questions below, write out the function call to answer the given question.
For example, for the question “Given x = -5
, use a built-in function to compute the absolute value of x
”, the answer should be abs(x)
.
Your answer might not be an exact match. It might vary in terms of spaces or order of the arguments. It is fine as long as it is valid.
Try out your answers in an interactive prompt. Experiment freely with different input arguments.