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