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