1. Главная
  2. Библиотека
  3. Программирование
  4. 26. About the single-underscored member proc, double-underscored...
Решение задачи на тему

26. About the single-underscored member proc, double-underscored proc member, and proc in Python, which of the following statements are true? () A. from module import * can be directly used to import the single-underscored member proc. B. from module

  • Программирование
  • #Основы алгоритмизации и программирования
  • #Языки программирования (C++, Java, Python и др.)
26. About the single-underscored member proc, double-underscored proc member, and proc in Python, which of the following statements are true? () A. from module import * can be directly used to import the single-underscored member proc. B. from module

Условие:

26. About the single-underscored member proc, double-underscored proc member, and proc in Python, which of the following statements are true? ()
A. from module import * can be directly used to import the single-underscored member proc.
B. from module import * cannot be directly used to import the double-underscored member _proc.
C. In Python, the parser uses \square classname proc to replace the double-underscored member \square proc
D. In Python, proc is a specific indicator for magic methods
Previous
Next
Uncertain

Решение:

Lets analyze each of the statements regarding single-underscored and double-underscored members in Python:

A. **from module import * can be directly used to import the single-underscored member proc.

  • True.** In Python, single underscore-prefixed members (e.g., _proc) are considered protected by convention, but they can still be imported using from module import . However, its generally discouraged to use import due to potential namespace pollution.

B. **from module import * cannot be directly used to import the double-underscored member proc.

  • True.** Double underscore-prefixed mem...

Выбери предмет