confusions in OOPs
why 'var' is not taking the global value in function as it is taking in class
can i create a local variable like 'a' in classes (say,c)?
why cant define class's attribute inside class body , like the way i done in function?
why 'f.a' is not callable but clss.c is callable? ( both assigned similarly )'''
(i am a beginner , my only option to ask and clear my concepts is to ask online python community for help bcz i m learning online).
#error statements commented out
var=10
def fun():
#var=var*10
a=10
fun.b=20
fun()
print(var)
#print(a)
print(fun.b)
#print(fun.a)
class clss:
var=var*var
c=10
#clss.d=20
#print(c)
#print(clss.d)
print(clss.var)
print(clss.c)