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