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 | 1736+ Python FAQs | Share
condition | string-iteration | parameter | multithreading | math | update | tuple-unpacking | classes | context-manager | syntax-error | attribute | format | heap-memory | memory-management | default-mutable-argument | memory | random-function | string-method | string-method | counter | round-function | slice | identity-operator | max-min | id-function | mathematical-function | decimal | map-function | static-method | filter | match | deep-copy | destructor | variable | append | class-and-inheritance | magic-method | exception-handling | control-statement | global-variable | loop | import-method | async | list-vs-tuple | logical-operator | statement | function-argument | while-loop | comprehension | random | logical-operation | bitwise-operator | list-operation | datetime | input-function | expand-tab | return-statement | virtual-environment | string-formatting | while-and-for-loop | join | higher-order-function | method | file-handling | recurssion | data-structure | operator | def | threading | counter-function | file | for | function | boolean | built-in | dictionaries | iterator | conversion | oop | zfill-function | operator-or | name-mangling | keyword | objects | conditional-statement | file_handling | dicts | class-and-instance-variable | rollback | pep | with-statement | data-structure | input-function | scientific-notation | syntax-error | identifier | asyncio | expression | numpy | sorting | mapping-function | python-repl | arithmetic-expression | assignment-operator | encoding | class-and-object | python | else-statement | collections | benefit | exception-handling | boolean-and-non-boolean | comment | virtual-environment | string-slicing | file-handling | python-history | functional-programming | input | exponentiation | identity-operator | control-flow | methods | lambdas | enumerate() | multiple-inheritance | pandas | factorial-function | array | object-attribute | collection | iterable | functions | raise | invalid-list | operator-and | indentation | call | pseudocode | operations | loops | string-concatenation | docstring | indexing | namespace | overflow | descriptors | numeric | list-mutation | shallow-copy | immutable-data-type | choice | error | yield | sum() | lambda | sys | bitwise | basic | binary-operation | mathematics | list-comprehension | module | access-modifier | while-else-loop | package-management | sys-module | turtle | fabs-function | exception | syntax | assert | list-comprehension | complex | dictionary | generator | operand | multiprocessing | error-handling | built-in-function | math-copysign | swapping | namedtuple | list-join | precedence-and-associativity | filter-function | zip-function | constructor | regular-expression | asyncio-module | compute | list | int | matplotlib | arithmetic-operation | escape-operator | string | bitwise-operator | set-operation | python-module | typeerror | init | logical-operator | string-slicing | global-variable | __init_subclass__ | data-type | mutable | data-structures | operator-overloading | string-manipulation | tuple | postfix | application | built-in-function | complex-number | operators | polymorphism | list-method | __all__-attribute | inherit | oops | inheritance | data_structure | decorator | immutability | list-indexing | comparison | copy | installation | __future__ | slicing | conditional-statement | staticmethod | function-and-scope | global | mysql | split | print | data-type | head-and-tail | goto-function | thread | touples | zip | loop-control | python_version | min-function | matrix | pickling-&-unpickling | feature | generators | string-formatting | stack | syntaxerror | generators-in-python | binary | precedence | recursion | software-design | sum-function | print-statement | set | frozenset | debugging | list-slicing | type-conversion | lambda-function | gil | type-conversion | type_conversion | implementation | class | nested-loop | library | command-line-parsing | version | interpreter | sorted | matrix-list-comprehension | control-flow | odd-number | python-django | min-max-function | lists | formal-and-actual-parameter | encapsulation | datatype | center | integer | floating-point-precision | version-check | design-principle | regex | global-keyword | range | round ...