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