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


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

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