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