This website requires JavaScript.
Explore
Help
Register
Sign In
chenxuan
/
python
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
047af26d70caa50261aa0e0f4879a649367333f7
python
/
pythonProject
/
数据类型
/
列表
/
count.py
T
3 lines
93 B
Python
Raw
Normal View
History
Unescape
Escape
no message
2025-10-21 18:00:11 +08:00
l
=
[
1
,
2
,
3
,
1
,
1
,
1
,
1
,
1
,
1
]
# count 返回指定对象在list中出现的次数
print
(
l
.
count
(
1
))
Reference in New Issue
Copy Permalink