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