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