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