Possible Duplicate:
Python variable declaration
i’m new to python, and i wonder how to put a proper “empty” variables into classes.
For example, in C++, I can put variables like:
public class employee{
private:
int ID;
string name;
public:
.....
}
In python, how do I setup the name and the id without giving them values?? Is it something like:
class employee:
__name__
__id__
...
Also, is it possible to set the data type for each variables?
It’s true that you can’t really do that, but here’s what you can do:
Also, no need to declare datatypes in Python. That’s the whole point of a dynamic language!
Don’t write python with a C++ accent. Write python the way it was designed and you’ll be a lot happier.