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