PHP » PYTHON |
login |
register |
about
|
PYTHON array_fill_keys
is this article helpful?
|
Python replacement for PHP's array_fill_keys
[
edit
| history
]
result = dict.fromkeys(keys, value) array_fill_keys(PHP 5 >= 5.2.0) array_fill_keys — Fill an array with values, specifying keys DescriptionFills an array with the value of the value parameter, using the values of the keys array as keys. Parameters
Return ValuesReturns the filled array Examples
Example #1 array_fill_keys() example
<?php The above example will output: Array ( [foo] => banana [5] => banana [10] => banana [bar] => banana )
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|