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