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


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

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