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


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

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