View difference between Paste ID: c9W3ywEf and t8UMTprV
SHOW: | | - or go back to the newest paste.
1
class MyClass:
2
3
	def __init__(self, somedata):
4
		print somedata
5
		self.data = somedata
6
7
8
	def function(self):
9
		print self.data
10
11
	def hey(self, cool):
12
		self.data = cool
13-
class = MyClass()
13+
class = MyClass("data1")
14
class2 = MyClass("unicorn")
15
16-
class.function()
16+
17
class.hey("hello")
18
class.function()
19
20
class2.function()
21
22
class.hey("yoo")
23
24
class2.hey("yaya")
25
26
class.function()
27
28
class2.function()