Hello fellows...
Is there something like static function variables in python?
I know there are static attributes of a class, but what if i want
to use a static variable inside a function?
somthing like this (stupid) code in c++ for example:
int static_num()
{
static int x = 0;
return ++x;
}
void main()
{
for (int i=0; i<10; i++)
{
cout << static_num() << endl;
}
}
If there aren't such static variables , is there a way for doing something similar to this c++ code?
thanks a lot!