0 votes
in Python by
what is encapsulation?

1 Answer

0 votes
by

Encapsulation is the binding of data and functions that manipulate the data.

It is a process of wrapping up data and variables together.

example

class playercharacter():

def __init__(self,name,age):

self.name = name

self.age = age

player1 = playercharacter(‘leo’,25)

print(player1.name)

print(player1.age)

Related questions

+1 vote
asked Jan 30, 2022 in Python by sharadyadav1986
+1 vote
asked Jan 30, 2022 in Python by sharadyadav1986
...