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