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 | 1736+ Python FAQs | Share
operator-overloading | encoding | dictionary | turtle | for | complex | statement | while-else-loop | version | assert | file | function | docstring | identity-operator | datatype | debugging | destructor | generators | loop | collection | numeric | odd-number | dictionaries | overflow | memory-management | min-function | indentation | scientific-notation | async | id-function | exception-handling | list-comprehension | error | command-line-parsing | postfix | else-statement | multiple-inheritance | conversion | matplotlib | invalid-list | numpy | functions | higher-order-function | loop-control | operators | formal-and-actual-parameter | binary-operation | print | implementation | python-history | counter-function | data-type | precedence-and-associativity | data-structure | built-in | class-and-instance-variable | filter | __future__ | function-and-scope | arithmetic-expression | escape-operator | comparison | sum() | tuple | mutable | inheritance | range | set-operation | type-conversion | file-handling | global-variable | control-flow | methods | mathematics | while-loop | type-conversion | matrix-list-comprehension | __all__-attribute | matrix | goto-function | classes | stack | list-comprehension | join | pickling-&-unpickling | update | conditional-statement | python_version | yield | control-flow | immutable-data-type | syntaxerror | python-django | input-function | condition | keyword | with-statement | application | round-function | recurssion | exception-handling | bitwise-operator | polymorphism | string-manipulation | operator-and | head-and-tail | boolean | static-method | input-function | asyncio | filter-function | lambda-function | generators-in-python | design-principle | decimal | string-method | binary | pep | return-statement | list-mutation | built-in-function | init | __init_subclass__ | feature | python-module | bitwise-operator | compute | data-structure | basic | string-iteration | list-slicing | method | global-keyword | regex | factorial-function | generator | sum-function | namespace | datetime | input | data-type | floating-point-precision | data_structure | list-operation | list-method | dicts | magic-method | round | default-mutable-argument | regular-expression | raise | asyncio-module | shallow-copy | variable | error-handling | math | def | list | attribute | oops | call | string-method | exponentiation | sorting | counter | package-management | library | indexing | frozenset | sys | module | interpreter | operand | control-statement | string-formatting | integer | exception | immutability | boolean-and-non-boolean | expression | string | string-slicing | installation | parameter | recursion | class | identity-operator | sorted | string-concatenation | syntax-error | lists | print-statement | objects | array | pandas | built-in-function | precedence | swapping | data-structures | object-attribute | operations | loops | version-check | slicing | operator | pseudocode | choice | rollback | append | class-and-object | staticmethod | arithmetic-operation | sys-module | class-and-inheritance | match | copy | string-slicing | mathematical-function | fabs-function | iterable | python | while-and-for-loop | benefit | complex-number | heap-memory | operator-or | threading | int | zip | list-indexing | thread | memory | mysql | global | collections | slice | list-join | zfill-function | constructor | access-modifier | lambdas | zip-function | type_conversion | inherit | set | file-handling | comprehension | python-repl | oop | global-variable | format | import-method | syntax-error | namedtuple | list-vs-tuple | virtual-environment | software-design | assignment-operator | descriptors | center | identifier | function-argument | name-mangling | max-min | multiprocessing | conditional-statement | touples | random | syntax | logical-operation | split | file_handling | comment | expand-tab | bitwise | logical-operator | typeerror | random-function | virtual-environment | deep-copy | gil | tuple-unpacking | enumerate() | multithreading | nested-loop | mapping-function | math-copysign | context-manager | string-formatting | functional-programming | map-function | lambda | decorator | encapsulation | iterator | min-max-function | logical-operator ...