Level 5 : What is the output?


a = [1, 2, 3]
b = (x*x for x in a)
a.append(4)
print(list(b))

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