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


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

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