Level 9 : What will be the output of the following Python code?s=["pune", "mumbai", "delhi"] [(w.upper(), len(w)) for w in s]


s=["pune", "mumbai", "delhi"]
[(w.upper(), len(w)) for w in s]

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