13 lines
213 B
Python
13 lines
213 B
Python
#!/usr/bin/env python
|
|
|
|
stepX = 3
|
|
posX = 0
|
|
trees = 0
|
|
with open("input01.txt","r") as f:
|
|
for line in f:
|
|
line = line.strip()
|
|
if line[posX] == '#':
|
|
trees +=1
|
|
posX = (posX + stepX) % (len(line))
|
|
|
|
print(trees) |