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