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