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