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