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