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 week ago

laserlab commented 1 week 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 6 days ago

Can list comprehension be thought of as a function?

haiderabbas007 commented 6 days 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?