ubsuny / CP1-24-HW3

Homework 3 template for CP1-24
1 stars 16 forks source link

A list is not a function #42

Open laserlab opened 1 month ago

laserlab commented 1 month ago

I just want to clarify that a list is a data type in Python and not a function.

so this:

list(map(lambda x: x+1))

does not return a function.

haiderabbas007 commented 1 month ago

Can list comprehension be thought of as a function?

haiderabbas007 commented 1 month ago

More interestingly, what about a dictionary? It assigns a value to every key, so in the mathematical sense, it is a function, but do we consider it a function here?