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