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