python for loop if code example
Example 1: for-else in python
numbers = [2, 4, 6, 8, 1]
for number in numbers:
if number % 2 == 1:
print(number)
break
else:
print("No odd numbers")
Example 2: if loop in python syntax
if a>b :
print(a)