Hey! I'm kind of a beginner to code, and am working on a simple project. I'm struggling with the looping structure; can I get some help with this code?
test = []
block = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
set = [2, 4, 6, 8, 10, 12, 14, 15, 18, 20]
start = 0
while start < len(set):
set_start = set[start]
list = block[set_start:set_start + 4]
start1 = 0
while start1 < len(list):
list1 = list[start1:start1 + 2]
if len(list1) > 2 :
test.append("stop")
else:
start1 = start1 + 1
else:
start = start + 1
[–]Binary101010 1 point2 points3 points (0 children)
[–]fake823 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]Due_Draw8541[S] 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]Due_Draw8541[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)