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