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