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