Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
263 B
3
Indexable
Never
file = open("liczby.txt", "r")
liczby = []
lib = 0
for line in file:
    line = line.strip()
    digit1=int(line[0])
    digit2= int(line[1])
    digit3=int(line[2])
    if digit1 == digit2 == digit3:
        lib+=1
        liczby.append(line)

print(lib, liczby)