|
Помогите с тестовым заданием
|
|||
---|---|---|---|
#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, 19:15 |
|
Помогите с тестовым заданием
|
|||
---|---|---|---|
#18+
в PHP в функции к переменной добавляется модификатор static и тогда при след. вызове функции в переменной будет то значение, которое было при выходе из функции ... |
|||
:
Нравится:
Не нравится:
|
|||
08.04.2018, 22:17 |
|
|
start [/forum/topic.php?fid=23&msg=39627325&tid=1460316]: |
0ms |
get settings: |
8ms |
get forum list: |
13ms |
check forum access: |
5ms |
check topic access: |
5ms |
track hit: |
45ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
39ms |
get tp. blocked users: |
2ms |
others: | 328ms |
total: | 458ms |
0 / 0 |