Level 5 : What will be the output of the following code?


def fun():
    return[i for i in range(0,3,3)]
print(fun())

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