Level 10 : What will be the output of this code?


s = "Python"
print(s[0:2])

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