Level 9 : What will be the output of the following Python code?


x = 'abcd'
for i in x:
    print(i.upper())

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