0
Any one know how to count in python ?
4 ответов
+ 2
sampleList = [1, 'one', 2, 'two', 'one'];
print ("Count for 1 : ", sampleList.count(1))
print ("Count for one : ", sampleList.count('one'))
+ 1
for i in range(100):
print(i)
0
normal counter:
count = 0
for i in range (10):
count = count +1
print count
___________________
if u are using function and want to make count:
count = 0
def counter():
global count += 1
0
np.count()