user97594
0
Q:

attributes in python

# Attributed are basically properties a class have from other classes.
# They are usually variables.
# Example:
class foo:
    # Making a vairable here...
    somevar = "Hello there"

print(foo.somevar) # will print "Hello there"
# Then you can set the attribute (variable) to another variable
anothervar = foo.somevar
print(anothervar) # still will print "Hello there"
2

New to Communities?

Join the community