Hi, for the example below, I don’t understand why it needs to be indented like this. Especially why does if found:
need to be aligned with for n2 in num_list:
?
for n1 in num_list:
for n2 in num_list:
if(n1 != n2):
if(n1 + n2 == n):
found = True # Set found to True
break # Break inner loop if a pair is found
if found:
print(n1, n2) # Print the pair
break # Break outer loop if a pair is found
Course: https://www.educative.io/courses/python-fundamentals-for-programmers
Lesson: https://www.educative.io/courses/python-fundamentals-for-programmers/qVZYY02mgR3
Course: https://www.educative.io/courses/python-fundamentals-for-programmers
Lesson: https://www.educative.io/courses/python-fundamentals-for-programmers/qVZYY02mgR3