Level 1 : What is the output for the below code?


a = [1,2,3,4]
print(a[::-1])

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