-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGroup People.py
More file actions
36 lines (28 loc) · 796 Bytes
/
Group People.py
File metadata and controls
36 lines (28 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
__author__ = 'deepika'
def display(gap):
grid = [[ 0 for _ in range(5)] for k in range(10)]
save = 1
start = save
for i in range(10):
if (start > 1):
start = save + 5
save = start
for j in range(5):
if (j == 1):
start = start + gap
grid[i][j] = start % 50 if start % 50 != 0 else 50
start = start + 1
print customDisplayGrid2(grid)
def customDisplayGrid2(grid):
line = ''
for row in grid:
line += ', '.join(str(x) for x in row)
line += '\n'
return line
if __name__ == "__main__":
grid = [[ 0 for i in range(5)] for j in range(10)]
gap = 0
for i in range(10):
print "For week: ", i + 1
display(gap)
gap = gap + 5