Level 1 : What will be the output of the following code?


x = (2, 5, 7, 8, 3, 4, 3, 6, 9)
print(x.index(3))

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