meaning of next loop in python code example
Example 1: loops in python
#While Loop:
while ("condition that if true the loop continues"):
#Do whatever you want here
else: #If the while loop reaches the end do the things inside here
#Do whatever you want here
#For Loop:
for x in range("how many times you want to run"):
#Do whatever you want here
Example 2: python continue
nums = [7,3,-1,8,-9]
positive_nums = []
for num in nums:
if num < 0: #skips to the next iteration
continue
positive_nums.append(num)
print(positive_nums) # 7,3,8