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