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