S1 ve s2 için 2 örnek oluşturmaya çalıştım, ancak bellek iki kez yazılıyor. alıyorum:2 yerine bellek üzerine yazma 2
: s1 = domain_monitor();
s1.name = "s1";
s1.tasks.append("Out of the World");
s2 = domain_monitor();
s2.name = "s2";
s2.tasks.append("Book: Decision Procedure");
ben aşağıdaki gibi çıktı yazdırmak:
class domain_monitor:
name = '';
tasks = [];
ben aşağıdaki gibi örneklerini doldurma başladı:
Out of the World
Book: Decision Procedure
=========================================
Out of the World
Book: Decision Procedure
instead of
Out of the World
=========================================
Book: Decision Procedure
How is this so?
aşağıdaki gibi bir sınıf yarattı
for v in s1.tasks: #
print v
print " ========================================= "
for v in s2.tasks: #
print v