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 | 1859+ Python FAQs | Share
__all__-attribute | descriptors | escape-operator | threading | handling-missing-values-(fillna,-dropna) | head-and-tail | shallow-copy | immutable-data-type | sys-module | immutability | boolean-masking | set | recursion | zip | indexing | else | thread | __future__ | reading:-read(),-readline(),-readlines() | inheritance | type-conversion | id-function | walking-through-directories-using-os.walk() | call | sorting-and-ranking | conversion | functions | type-conversion-and-casting | class-decorators | function-argument | list | mathematical-function | keyword | typeerror | else-statement | counter | using-yield-in-functions | built-in-function | using-the-threading-module | list-operation | arithmetic-operation | sys | mysql | data-types | iterators | touples | async | sum() | lists | implementation | name-mangling | list-vs-tuple | datetime | math-copysign | introduction-to-multiprocessing | assignment-operators | multiprocessing | input-function | filter-function | functional-programming | encoding | using-lists-as-stacks | sorted | dictionary-methods | data-structures-in-python | inherit | literal-characters-and-special-characters | loop | managing-directories-with-os-and-shutil | working-with-temporary-files-using-tempfile | formatting-with-strftime | basic | control-flow | multithreading | regular-expressions | fabs-function | type_conversion | split | test-discovery | __init_subclass__ | identity-operators-(is,-is-not) | function-and-scope | conditional-statement | introduction-to-python | matrix-list-comprehension | thread-synchronization | match | multiple-except-blocks | key-value-pairs | datatype | string-method | assignment-operator | built-in | access-modifier | loops | max-min | data-type-conversions | min-function | datetime.date,-datetime.time,-datetime.datetime | loop-control | why-use-multiprocessing-over-threading?-(gil) | multiple-inheritance | deep-copy | file | while-loop | enumerate() | working-with-file-paths | error-handling | method-overloading | built-in-modules | filtering-and-indexing | decorator | statement | introduction-to-threads | indentation | thread-safe-data-structures-(queue.queue) | condition | namedtuple | creating-and-starting-threads | generator | logical-operators | bitwise-operator | dataframe-and-series-objects | complex-number | rollback | slicing | exception-handling | list,-set,-and-dictionary-comprehensions | global | tuple-unpacking | min-max-function | constructor | using-os-and-pathlib-modules | exception | single-inheritance | lambda-functions | import-method | design-principle | format | time-series-with-pandas | creating-custom-modules | booleans | recurssion | tuple | method | for | logical-operator | multiple-inheritance | intering | string-methods | round | unit-testing | class | logical-operation | complex | compute | iterator | default-mutable-argument | functional-programming | conditional-statements | strings | random | feature | namespace | numpy | round-function | control-statement | integer | directory-operations | dicts | python_version | debugging | regex | slice | frozenset | with-statement | map-function | anchors-(^,-$) | list-mutation | writing:-write(),-writelines() | pep | yield | global-keyword | list-comprehensions | destructor | bitwise | attribute | memory | generators-in-python | parameter | formal-and-actual-parameter | math | zip-function | raise-statement | decimal | identifier | bitwise-operator | virtual-environment | python-repl | static-method | loop-control-statements | operators | invalid-list | application | syntax-error | int | variable | class-and-inheritance | built-in-function | binary | nested-loop | filter | list-methods-and-slicing | difference-between-threads-and-processes | tuples | advanced-file-operations | syntax | print-statement | copy | append | set-operation | counter-function | overriding-methods | matrix | default-arguments | joining-and-merging-dataframes | methods | center | binary-operation | list-slicing | data-type | turtle | pseudocode | dictionary | file-handling | quantifiers-(*,-+,-?,-{}) | library | syntax-error | using-assertions-(assertequal,-assertraises) | random-function | parsing-with-strptime | version-check | postfix | aggregating-data-with-functools.reduce() | staticmethod | list-method | context-manager | function | dictionary-comprehensions | tuple-methods | virtual-environment | file_handling | interpreter | conditional-statement | string | matplotlib | operand | range | data-structure | update | floats | data-structure | iterable | pass | stack | docstring | sets | mathematics | lambdas | identity-operator | command-line-parsing | error | global-variable | version | file-handling | string-iteration | error-handling | mapping-function | using-join()-and-is_alive()-methods | memory-management | def | comprehension | input-function | exception-handling | while-and-for-loop | dictionaries | sum-function | objects | logical-operator | string-formatting | scientific-notation | string-formatting | swapping | assert | module | python | regular-expression | data-type | list-comprehension | membership-operators-(in,-not-in) | init | data-structures | data_structure | mutable | while-else-loop | higher-order-function | object-attribute | classes | goto-function | operations | heap-memory | indexing:-loc-vs-iloc | arbitrary-arguments-(*args,-**kwargs) | input | numeric | odd-number | class-and-object | choice | raise | integers | string-manipulation | collections | boolean-and-non-boolean | list-comprehension | using-map()-for-transformations | global-variable | pandas | oops | exponentiation | collection | operator-and | string-slicing | control-flow | python-module | string-method | array | oop | precedence-and-associativity | zfill-function | reading-and-writing-large-files-efficiently | operator-or | boolean | asyncio-module | benefit | arithmetic-expression | floating-point-precision | comparison | working-with-dates-and-times | python-operators | python-history | overflow | class-and-instance-variable | software-design | while-loops | using-else-and-finally | python-django | operator-overloading | pickling--unpickling | python-syntax-and-structure | string-slicing | asyncio | polymorphism | comment | encapsulation | generators | print | string-concatenation | package-management | expand-tab | gil | type-conversion | opening-files-(open()) | join | expression | operator | identity-operator | installation | list-join | lambda-function | lambda | list-indexing | factorial-function | working-with-binary-files-(rb,-wb) | return-statement | sorting | precedence | magic-method | syntaxerror | defining-functions | reading-and-writing-files ...