Resolved: If those are functions, why don't we close it with a colon and execute "return" this time?
In the previous chapter the functions "def" ends with a colon to designate the next indentation line. And then we execute with the prompt "return". Why not here?
1 answers ( 1 marked as helpful)
Hi Phanas!
Thanks for reaching out!
In Python, built-in functions are predefined functions provided by the language. These don't need to be defined by the user. When using built-in functions, you simply call them by their name and provide any necessary arguments. There’s no need to define them with def
and a colon(:), or to use return
, as these functions are already implemented and ready to use.
Hope this helps.
Best,
Ivan