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