for y in x python code example
Example 1: for in python
# how to use for in python for (range, lists)
fruits = ["pineapple","apple", "banana", "cherry"]
for x in fruits:
if x == "apple":
continue
if x == "banana":
break
print(x)
# fron 2 to 30 by 3 step
for x in range(2, 30, 3):
print(x)
Example 2: x for x in python
# This could be said as:
x for x in thing:
# Or
for x in thing:
return x # Or whatever that puts x in some variable
# Same thing, just really dodgy syntax.