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