Telegram Group & Telegram Channel
Код выведет 'Bob', потому что res — это класс, и ему присваивается атрибут name на уровне класса (res.name = 'Bob'). Затем создаётся экземпляр x = res(), у которого нет собственного атрибута name. При вызове x.name интерпретатор ищет атрибут сначала в экземпляре x, затем в его классе res. Поскольку у res есть атрибут name, возвращается 'Bob'. Это пример наследования атрибутов экземпляром от класса.



tg-me.com/quiz_python/3973
Create:
Last Update:

Код выведет 'Bob', потому что res — это класс, и ему присваивается атрибут name на уровне класса (res.name = 'Bob'). Затем создаётся экземпляр x = res(), у которого нет собственного атрибута name. При вызове x.name интерпретатор ищет атрибут сначала в экземпляре x, затем в его классе res. Поскольку у res есть атрибут name, возвращается 'Bob'. Это пример наследования атрибутов экземпляром от класса.

BY Python: задачки и вопросы


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/quiz_python/3973

View MORE
Open in Telegram


Python: задачки и вопросы Telegram | DID YOU KNOW?

Date: |

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.

Importantly, that investor viewpoint is not new. It cycles in when conditions are right (and vice versa). It also brings the ineffective warnings of an overpriced market with it.Looking toward a good 2022 stock market, there is no apparent reason to expect these issues to change.

Python: задачки и вопросы from us


Telegram Python: задачки и вопросы
FROM USA