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


print("Hello {0!r} and {0!s}".format('foo', 'bin'))

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