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


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

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