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