Level 9 : What is the output of the following program ?


mylist = [10, 20, 5, 30, 15]
print(mylist[:-1])

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