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