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