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