-
[Python tutorial] 23. Tuple Methods코딩/Python 2022. 12. 21. 17:28728x90
tuple.count(value)
Returns the number of times a specified value occurs in a tuple
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5) x = thistuple.count(5)
tuple.index(value)
Searches the tuple for a specified value and returns the position of where it was found
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5) x = thistuple.index(8)
728x90'코딩 > Python' 카테고리의 다른 글
[Python tutorial] 25. File Methods (0) 2022.12.21 [Python tutorial] 24. Set Methods (0) 2022.12.21 [Python tutorial] 22. Dictionary methods (0) 2022.12.21 [Python tutorial] 21. List/Array methods (0) 2022.12.21 [Python tutorial] 20. String methods (1) 2022.12.21