Level 1 : What is the output of the below code?


a=[1,2,3,4]

a.remove(2)
a.pop(1)
del a[1]

print(a)

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