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


str = "Welcome to the\n jungle"
print(str.splitlines())

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