fix(curriculum): update count() function to count() method in tuple section (#66162)

This commit is contained in:
Jeevith K
2026-03-02 17:51:54 +05:30
committed by GitHub
parent 5a0e9d6cd8
commit d4533e7621
@@ -355,14 +355,14 @@ programming_languages = ('Rust', 'Java', 'Python', 'C++', 'Rust')
programming_languages.count('Rust') # 2
```
- If the specified item in the `count()` function is not present at all in the tuple, then the return value will be `0`:
- If the specified item in the `count()` method is not present at all in the tuple, then the return value will be `0`:
```py
programming_languages = ('Rust', 'Java', 'Python', 'C++', 'Rust')
programming_languages.count('JavaScript') # 0
```
- If no arguments are passed to the `count()` function, then Python will return a `TypeError`.
- If no arguments are passed to the `count()` method, then Python will return a `TypeError`.
- **index()**: Used to find the index where a particular item is present in the tuple. Here is an example of using the `index()` method to find the index for the language `'Java'`: