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