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