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 | 1736+ Python FAQs | Share
syntaxerror | docstring | python-repl | module | comment | iterable | raise | type-conversion | goto-function | data-structure | inheritance | sys | operator-and | immutability | python-django | default-mutable-argument | update | dictionary | syntax-error | operations | mysql | context-manager | syntax-error | int | method | stack | mapping-function | for | type-conversion | command-line-parsing | split | polymorphism | while-else-loop | global-variable | generators | __all__-attribute | filter-function | data-structures | precedence | feature | compute | exception | arithmetic-expression | string-manipulation | __init_subclass__ | list-slicing | max-min | name-mangling | round-function | datetime | multiple-inheritance | implementation | function | global | class-and-inheritance | oops | built-in-function | encoding | virtual-environment | call | string-method | identifier | list-comprehension | bitwise-operator | library | constructor | lambda-function | conversion | parameter | sum() | object-attribute | list | input | keyword | conditional-statement | choice | data-type | regex | typeerror | syntax | control-flow | return-statement | encapsulation | comparison | static-method | list-method | async | functions | class-and-instance-variable | print | built-in-function | zfill-function | numeric | string-concatenation | overflow | file | id-function | variable | recurssion | pandas | complex-number | threading | namespace | boolean | operator-overloading | assert | generators-in-python | bitwise | loops | attribute | recursion | input-function | range | set | arithmetic-operation | list-join | heap-memory | slicing | def | class | print-statement | installation | shallow-copy | benefit | binary-operation | list-vs-tuple | higher-order-function | math | data_structure | map-function | counter | center | scientific-notation | comprehension | control-statement | mathematical-function | precedence-and-associativity | lists | pep | staticmethod | list-comprehension | nested-loop | collection | sorting | join | objects | interpreter | python-module | formal-and-actual-parameter | iterator | logical-operation | input-function | indentation | operator-or | namedtuple | data-type | application | python_version | list-mutation | fabs-function | loop | min-max-function | expand-tab | list-operation | string-formatting | factorial-function | version | tuple | sum-function | gil | format | rollback | bitwise-operator | exception-handling | binary | head-and-tail | operators | virtual-environment | function-argument | data-structure | round | floating-point-precision | dictionaries | pseudocode | tuple-unpacking | filter | touples | memory | list-indexing | yield | append | thread | logical-operator | built-in | error-handling | invalid-list | with-statement | destructor | matrix-list-comprehension | asyncio | swapping | software-design | lambdas | inherit | decorator | version-check | string-slicing | integer | match | asyncio-module | collections | operand | functional-programming | expression | global-keyword | sys-module | while-loop | identity-operator | logical-operator | decimal | slice | methods | escape-operator | zip | condition | string-method | math-copysign | type_conversion | complex | mutable | indexing | dicts | enumerate() | operator | regular-expression | string-iteration | debugging | oop | numpy | global-variable | python-history | pickling-&-unpickling | function-and-scope | conditional-statement | multithreading | string-formatting | assignment-operator | file_handling | string-slicing | classes | python | sorted | frozenset | matrix | deep-copy | class-and-object | random-function | generator | import-method | loop-control | matplotlib | while-and-for-loop | random | immutable-data-type | else-statement | file-handling | statement | counter-function | postfix | file-handling | multiprocessing | package-management | init | zip-function | array | turtle | identity-operator | error | mathematics | exponentiation | datatype | basic | access-modifier | control-flow | memory-management | set-operation | odd-number | boolean-and-non-boolean | lambda | magic-method | string | descriptors | exception-handling | min-function | __future__ | copy | design-principle ...