``` class Student: def __init__(self,name,age, gender,major): self.name=name self.age=age self.gender=gender self.major=major def __del__(self): print("The student records has been deleted successfully.") ``` The series of output is as follows:  I typed this code in IDLE and then run the module. After running the module, I created an object called "Student1" and pass the required values, then checked it. By calling **del** method the object was destroyed and thus trying to access any state of that previous object gives the output as "Student1 is not defined."
author | leoumesh |
---|---|
permlink | working-with-destructor-method-in-python |
category | python |
json_metadata | {"tags":["python","coding","programming","learning","programmer"],"image":["https://cdn.steemitimages.com/DQmQJcjH6QbVj4nTvpXJxKPhsdCoymAbf324dsX6S455kak/pyython.png"],"app":"steemit/0.2","format":"markdown"} |
created | 2020-03-14 14:10:24 |
last_update | 2020-03-14 14:10:24 |
depth | 0 |
children | 2 |
last_payout | 2020-03-21 14:10:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.054 HBD |
curator_payout_value | 0.053 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 744 |
author_reputation | 212,340,493,251,438 |
root_title | "WORKING WITH DESTRUCTOR METHOD IN PYTHON!!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 96,347,695 |
net_rshares | 444,566,809,867 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
anomaly | 0 | 153,104,573 | 1% | ||
hanggggbeeee | 0 | 35,893,725,677 | 100% | ||
asok | 0 | 627,189,630 | 100% | ||
shajj | 0 | 2,474,658,899 | 100% | ||
ganastha | 0 | 771,743,907 | 100% | ||
leoumesh | 0 | 46,593,638,265 | 100% | ||
shaheerbari | 0 | 10,870,241,007 | 100% | ||
myanmarvds | 0 | 549,130,876 | 100% | ||
witnessbot | 0 | 1,713,761,896 | 100% | ||
zuerich | 0 | 343,792,182,200 | 20% | ||
deepakgurau | 0 | 558,209,347 | 100% | ||
bhatta | 0 | 569,223,590 | 100% |
<div class='pull-right'>https://cdn.steemitimages.com/DQmaHThyECGhEx8tSfHZbiMFRNYjJ35K92cDgiJjkzBUaJo/One%20sip%20of%20BEER%20for%20you.gif<p><sup><a href='https://steem-engine.com/?p=market&t=BEER'>View or trade </a> <code>BEER</code>.</sup></p></div><center><br> <p> Hey @leoumesh, here is a little bit of <code>BEER</code> from @isnochys for you. Enjoy it!</p> <p>Learn how to <a href='https://steemit.com/beer/@beerlover/what-is-proof-of-stake-with-beer'>earn FREE BEER each day </a> by staking.</p> </center><div></div>
author | beerlover |
---|---|
permlink | re-working-with-destructor-method-in-python-20200315t103845z |
category | python |
json_metadata | "{"app": "beem/0.21.1"}" |
created | 2020-03-15 10:38:48 |
last_update | 2020-03-15 10:38:48 |
depth | 1 |
children | 0 |
last_payout | 2020-03-22 10:38:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 524 |
author_reputation | 25,782,713,665,946 |
root_title | "WORKING WITH DESTRUCTOR METHOD IN PYTHON!!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 96,371,699 |
net_rshares | 0 |
Have a witness !BEER
author | isnochys |
---|---|
permlink | re-working-with-destructor-method-in-python-20200315t103833 |
category | python |
json_metadata | "" |
created | 2020-03-15 10:38:36 |
last_update | 2020-03-15 10:38:36 |
depth | 1 |
children | 0 |
last_payout | 2020-03-22 10:38:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 20 |
author_reputation | 47,917,144,909,021 |
root_title | "WORKING WITH DESTRUCTOR METHOD IN PYTHON!!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 96,371,694 |
net_rshares | 0 |