Level 1 : What does this print?


nums = [1, 2, 3, 4]
squares = (x*x for x in nums if x % 2 == 0)
print(sum(squares))

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