Level 1 : What is the output of the following code?


print('abcdefghijfg'.split('fg', -1))

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