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