In python there is no such thing as "static" keyword unlike java.
For Funtions
You can add attributes to a function, and use it as a static variable.
def incrfunc():
incrfunc.tab += 1
print incrfunc.tab
# initialize
incrfunc.tab = 0
For Class
However, if you are making use of the classes in python below is the language convention.
All variables which are assigned a value in class declaration are
class variables. And variables which are assigned values inside class
methods are instance variables.
class CSStudent:
stream = 'cse' # Class Variable
def __init__(self,name,roll):
self.name = name # Instance Variable
self.roll = roll # Instance Variable
NOTE: If you ask me, it would always be good to make use of classes and use them inside off a class, it is my opinion.