Level 10 : What is the content of the variable a after the slice operation?


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

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