Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
08.04.2018, 19:15
|
|||
---|---|---|---|
|
|||
Помогите с тестовым заданием |
|||
#18+
Выскажите ваше мнение, у меня нет предположений -( Q: how do you make a variables only accessible within a function but cause the value to persist across calls to that function Answer: 1) Add a positional argument, with an empty tuple as default value, to the end of the argument list 2) Encapsulate access to the variable within set_x() and get_y() functions 3) Create a global variable at the veginning of the module and add the private declaration to that variable within the function 4) Create a global variable at the beginning of the module and add the "static" declaration to that variable within the function 5) Add the keyword argument, with a mutable a default value to the end of the function parameret list ... |
|||
:
Нравится:
Не нравится:
|
|||
|
08.04.2018, 22:17
|
|||
---|---|---|---|
|
|||
Помогите с тестовым заданием |
|||
#18+
в PHP в функции к переменной добавляется модификатор static и тогда при след. вызове функции в переменной будет то значение, которое было при выходе из функции ... |
|||
:
Нравится:
Не нравится:
|
|||
|
|
start [/forum/search_topic.php?author=%D0%A1%D0%B2%D1%8F%D1%82%D0%BE%D0%B9+%D0%9D%D1%8F%D0%BA%D0%B0-%D0%9B%D0%B0%D0%B9%D0%BA&author_mode=last_posts&do_search=1]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
get settings: |
11ms |
get forum list: |
10ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
42ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
44ms |
get tp. blocked users: |
1ms |
others: | 1783ms |
total: | 1937ms |
0 / 0 |