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