+ 1
what is a built-in function?
what is a built-in function?
1 Odpowiedź
+ 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".