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