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


import re
s = 'abc123 xyz666 lmn-11 def77'
re.sub(r'\b([a-z]+)(\d+)', r'\2\1:', s)

Author: KaivalyaG | Tags: regular-expression | 1736+ Python FAQs | Share
update | gil | descriptors | parameter | syntax-error | iterable | logical-operator | built-in-function | bitwise-operator | dictionary | shallow-copy | global-variable | pseudocode | syntax-error | touples | list-comprehension | goto-function | min-function | tuple-unpacking | zfill-function | operators | set | pandas | input | arithmetic-expression | string-formatting | with-statement | python-repl | type_conversion | enumerate() | copy | polymorphism | input-function | static-method | list-operation | classes | formal-and-actual-parameter | design-principle | sys-module | installation | oop | input-function | function-argument | round-function | round | postfix | integer | import-method | map-function | mathematical-function | logical-operator | functions | data-structures | range | bitwise-operator | datatype | data_structure | python | complex-number | join | __all__-attribute | generators-in-python | comparison | operator | lambda-function | data-type | stack | dictionaries | collection | sum-function | python-module | inheritance | raise | recursion | decimal | pickling-&-unpickling | floating-point-precision | loop-control | memory | split | conditional-statement | zip-function | while-loop | regex | string-slicing | module | mysql | while-and-for-loop | random-function | indentation | command-line-parsing | __init_subclass__ | else-statement | return-statement | data-structure | list-vs-tuple | iterator | class-and-instance-variable | operator-and | virtual-environment | assignment-operator | string-method | file_handling | immutability | class-and-object | slice | expression | error | mutable | counter-function | deep-copy | while-else-loop | string-iteration | factorial-function | exception | global-variable | string-formatting | built-in-function | exponentiation | class-and-inheritance | array | context-manager | lists | multithreading | inherit | list-mutation | keyword | asyncio-module | access-modifier | async | indexing | python_version | basic | global-keyword | methods | generators | overflow | numpy | call | identifier | control-flow | error-handling | function | print-statement | method | default-mutable-argument | list-join | application | built-in | counter | set-operation | control-flow | for | escape-operator | python-django | thread | encoding | asyncio | matrix-list-comprehension | conversion | immutable-data-type | destructor | feature | string-manipulation | random | multiple-inheritance | namespace | higher-order-function | binary-operation | recurssion | lambda | data-structure | data-type | functional-programming | zip | benefit | oops | lambdas | fabs-function | operand | yield | identity-operator | conditional-statement | slicing | file-handling | identity-operator | compute | list-comprehension | __future__ | string | constructor | max-min | mapping-function | frozenset | virtual-environment | int | objects | namedtuple | variable | multiprocessing | string-method | init | operator-or | nested-loop | swapping | precedence-and-associativity | sorted | collections | odd-number | math | arithmetic-operation | list-method | expand-tab | dicts | attribute | loop | choice | math-copysign | comment | interpreter | version | min-max-function | rollback | sorting | mathematics | sys | format | boolean | python-history | name-mangling | list-indexing | exception-handling | comprehension | operator-overloading | filter | class | loops | id-function | invalid-list | heap-memory | regular-expression | bitwise | software-design | implementation | version-check | object-attribute | list-slicing | complex | type-conversion | magic-method | decorator | file-handling | memory-management | operations | pep | list | assert | syntaxerror | append | matrix | library | string-concatenation | global | datetime | encapsulation | tuple | center | print | file | boolean-and-non-boolean | sum() | matplotlib | filter-function | generator | docstring | turtle | statement | debugging | threading | type-conversion | exception-handling | package-management | typeerror | scientific-notation | precedence | head-and-tail | string-slicing | condition | logical-operation | binary | function-and-scope | control-statement | def | match | staticmethod | numeric | syntax ...