Level 1 : What is the output of the below code?


import re

txt = "The rain in Spain"
x = re.search(r"\bS\w+", txt)
print(x.span)

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