Level 1 : What is the output of the following code?


import re

aa = "The rain in Spain"
x = re.sub("\s", "3", aa)
print(x)

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