def
constructor(
self
, arg):
self
.constructor_arg
=
arg
def
displayMethod(
self
, arg):
print
(arg)
@classmethod
def
classMethod
(
cls
, arg):
print
(arg)
Geeks
=
type
(
"Geeks"
, (
object
, ), {
"__init__"
: constructor,
"string_attribute"
:
"Geeks 4 geeks !"
,
"int_attribute"
:
1706256
,
"func_arg"
: displayMethod,
"class_func"
:
classMethod
})
obj
=
Geeks(
"constructor argument"
)
print
(obj.constructor_arg)
print
(obj.string_attribute)
print
(obj.int_attribute)
obj.func_arg(
"Geeks for Geeks"
)
Geeks.class_func(
"Class Dynamically Created !"
)