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