Level 1 : what is the output for the below code


def f(x=[]):
    x.append(1)
    return x

print(f(), f())

Author: VenuEmmela | Tags: list | 1736+ Python FAQs | Share
operand | comment | command-line-parsing | frozenset | min-function | id-function | sys | method | touples | random-function | python-django | multithreading | memory-management | oop | numpy | iterator | class-and-object | choice | return-statement | round | gil | immutability | tuple | dictionaries | data-type | data-structure | while-and-for-loop | list-operation | context-manager | range | assert | identifier | mutable | global-keyword | python-history | input-function | binary-operation | function-argument | format | sum-function | mathematics | threading | python_version | boolean-and-non-boolean | docstring | error | attribute | bitwise-operator | min-max-function | tuple-unpacking | installation | raise | data-type | virtual-environment | lists | expression | boolean | decorator | formal-and-actual-parameter | string-slicing | destructor | memory | debugging | generators-in-python | enumerate() | invalid-list | function-and-scope | counter | async | heap-memory | conditional-statement | list-comprehension | with-statement | identity-operator | virtual-environment | turtle | sum() | python-repl | string-iteration | string-manipulation | set-operation | list-slicing | __all__-attribute | generator | print-statement | fabs-function | collection | overflow | match | global-variable | for | stack | namedtuple | array | while-loop | encapsulation | sys-module | file | immutable-data-type | decimal | sorted | class-and-inheritance | oops | precedence | file_handling | version-check | operator-or | datatype | scientific-notation | math | object-attribute | lambda | update | classes | recursion | global-variable | counter-function | access-modifier | mathematical-function | shallow-copy | pseudocode | inherit | string-method | zfill-function | matrix-list-comprehension | precedence-and-associativity | syntax-error | string-concatenation | nested-loop | error-handling | thread | string-formatting | escape-operator | list-method | encoding | benefit | application | file-handling | map-function | descriptors | keyword | mapping-function | dicts | conditional-statement | postfix | complex-number | assignment-operator | implementation | generators | append | bitwise-operator | random | list-indexing | arithmetic-operation | functional-programming | magic-method | asyncio | iterable | identity-operator | exception-handling | syntax | data-structure | staticmethod | default-mutable-argument | built-in-function | mysql | function | yield | loops | factorial-function | comprehension | indexing | arithmetic-expression | higher-order-function | exception | comparison | version | typeerror | variable | filter-function | head-and-tail | built-in | split | bitwise | call | matrix | list-vs-tuple | class | floating-point-precision | goto-function | operator-and | design-principle | int | indentation | parameter | interpreter | operators | expand-tab | else-statement | datetime | import-method | loop-control | logical-operator | zip | static-method | namespace | input | input-function | polymorphism | feature | center | asyncio-module | control-flow | print | compute | odd-number | dictionary | regex | pep | while-else-loop | exponentiation | python | string-slicing | conversion | lambda-function | inheritance | functions | objects | type_conversion | library | operations | collections | software-design | integer | string | def | filter | binary | swapping | pandas | rollback | set | zip-function | constructor | logical-operation | python-module | syntax-error | lambdas | math-copysign | operator-overloading | type-conversion | package-management | deep-copy | operator | multiple-inheritance | multiprocessing | class-and-instance-variable | built-in-function | data-structures | basic | list-join | type-conversion | matplotlib | join | complex | list-comprehension | copy | max-min | condition | regular-expression | global | string-formatting | loop | list-mutation | round-function | init | exception-handling | control-flow | syntaxerror | recurssion | statement | name-mangling | numeric | module | __future__ | control-statement | methods | data_structure | slice | list | slicing | string-method | __init_subclass__ | pickling-&-unpickling | file-handling | logical-operator | sorting ...