Level 1 : What will be the output of the following Python code?


re.match('sp(.*)am', 'spam')

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