0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Some new developers get hung up on the difference between print()
and return
.
It can be particularly confusing when the test suite we provide simply prints the output of your functions to the console. It makes it seem like print()
and return
are interchangeable, but they are not!
print()
is a function that:
return
is a keyword that:
print()
ed)Printing values and running your code is a great way to debug your code. You can see what values are stored in various variables, find your mistakes, and fix them. Add print statements and run your code as you go! It's a great habit to get into to make sure that each line you write is doing what you expect it to do.
In the real world it's rare to leave print()
statements in your code when you're done debugging. Similarly, you need to remember to remove any print()
statements from your code before submitting your work here on Boot.dev because it will interfere with the tests!
There's a problem in the get_title
function! It's supposed to calculate the title
value and return
it to the caller. Instead, it's barbarically printing the value to the console.
Fix the function so that it returns the title
instead of printing it to the console.
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution