+ 1

what is a built-in function?

what is a built-in function?

13th Feb 2019, 10:30 PM
thisisforthatj
1 Respuesta
+ 1
Built-in function and built-in types are built into the interpreter and are always available. You don't need to write any code that returns the max value in a list, you can use the built-in function "max()" instead. Since they are not keywords, you can override them. You can declare a variable named "max", but then you no longer will be able to use it as before. e.g. my_list = [1, 2, 3] print(max(my_list)) max = 5 print(max) print(max(my_list)) >>> 3 >>> 5 >>> TypeError TypeError because "max" is now an integer variable that contains the value "5".
14th Feb 2019, 12:56 AM
Pedro Tortello
Pedro Tortello - avatar