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