My doubt is when we use a built-in function name twice(once as a built-in function and the for naming the function with using the same name) and we give “del max” which will be deleted?
In the code below the output prints " “No max value returned” twice . Does that mean the built-in function will be deleted
a_list = [1, 8, 10, 9, 7]
print(max(a_list))
The latter function that you defined will be deleted.
In [1]: a_list = [*range(10)]
In [2]: max(a_list)
Out[2]: 9
In [3]: def max(a_list):
...: return "No max value returned"
In [4]: max_val_test = max(a_list)
In [5]: print(max_val_test)
No max value returned
In [6]: del max
In [7]: max
Out[7]: <function max>
In [8]: max(a_list)
Out[8]: 9