I've seen 'del' being referred to as a keyword and as a statement. Apparently, it is not considered a function:
Python has a del statement (keyword) to delete objects, not a del function.
https://tutorial.eyehunts.com/python/del-function-in-python-code/
I looked up the definition of a function in Python and it says:
In Python, a function is a group of related statements that performs a specific task.
Under this definition, I do not understand how del cannot be considered a function.
It does perform a specific task: deleting an item at a given index.
The syntax appears to be different, as you don't need parentheses to use the del statement:
motorcycles = ['honda', 'suzuki', 'yamaha']
del motorcycles[0]
But what are the other practical consequences of del being a statement/keyword rather than a function?
Finally, the main question here is: how do I identify something as a statement rather than a function and vice versa?
Considering that I'll have to know that in order to know the syntax needed, I think it is quite important for me to understand that.
I did some research and I found a few explanations to why functions are different than keywords:
Function is a lower designation than a keyword interaction - and in of itself - has to call higher designated System operative calls or akin - to fundamentally interact with memory partitioning.
The main reason for this - is how Python’s hierarchy is constructed in of itself.
But to me - a beginner in Python whose first programming language is R - that does not seem to help me identify something as a keyword instead of a function.
Plus, if a statement is different than a keyword, how is it that I've seen del being referred to as both a statement AND a keyword?
(What is the difference between a statement and a keyword?)
Can anyone shed some light on this, please? I'd really appreciate it!