Level 1 : What is the output of the following code?


a = ['xy','yz']
for i in a:
     a.append(i.upper())
print(a)

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