Level 5 : What will be the output of the following code?


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

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