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


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

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