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