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