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