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