Level 1 : what is the output of the code?


list = list("1234")
list[0] = list[1] = 5
print(list)

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