Level 10 : What will this print?


a = [1, 2, 3]
b = a.copy()
b[1] = 99
print(a, b)

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