I keep hearing "everything is an object" in both Ruby and Python world. Well, what are built-in functions then? Can someone explain that in layperson English? For example:
file=open(abc.txt) open is a built-in function. Is it an object? Is it a method? Of what class?
How did we even end-up with functions in Python if everything is an object? I mean, shouldn't we be having class, objects, methods and attributes, instead of functions? I thought we had functions in languages like C. Python, Ruby and Java had classes, objects, attributes, methods.
In Ruby (irb), you could do something like 1.class and this will give you Fixnumit will show you which class it belongs to. I don't seem to be able to do this in Python shell. Is there an equivalent?
FYI:
- I am using Python 2.7
- relatively new to programming so please use layperson English. For instance, I read in one of the answers "But everything is an object in the sense that it can be assigned to a variable or passed as an argument to a function" --- no idea what that means.