#!/usr/bin/python
fh = open("text")
lista= fh.readlines()
fh.close
lines = [lines[:-1] for lines in lista]
lines2=[int(i) for i in lines]
###############################
total=0
y=''
count=1
for x in lines2:
if x==y:
count+=1
total=count*x
else:
count=1
if total==0:
2+2
else:
print total
total=0
y=x
if total==0:
2+2
else:
print total
Ova poruka je od: http://www.linux.hr/newbb/viewtopic.php?forum=8&topic_id=2355&post_id=14710