Level 9 : What is the main difference between these two?


[x*x for x in range(5)]
(x*x for x in range(5))

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