我用python3.7.2生成了2个列表,B存放100以内的偶数,c存放100以内的奇数。如何统计B、c中数字的个数?
```python
B=[]
c=[]
dict = {}
for j in range(1,100):
if j%2==0:
B.append(j)
else:
c.append(j)
print('List of even number: ',B)
print('List of odd number: ',c)
我试过这个方法,但是不行
```python
set01=set(B)
dict01={}
for item in set01:
dict01.update({item:B.count(item)})
print(dict01)