while умова:
блок коду
i = 0
while i < 5:
print(i)
i += 1
for елемент in послідовність:
блок коду
my_list = [1, 2, 3, 4, 5]
for element in my_list:
print(element)
my_list = [1, 2, 3, 4, 5]
for element in my_list:
if element == 3:
break
print(element)
my_list = [1, 2, 3, 4, 5]
for element in my_list:
if element == 3:
continue
print(element)
for i in range(10):
pass
for i in range(1, 11):
for j in range(1, 11):
print(i * j, end="\t")
print()
my_list = [1, 2, 3, 4, 5]
for element in my_list:
print(element)
i = 1
while i <= 100:
print(i)
i += 1
my_list = [1, 2, 3, 4, 5]
total = 0
for element in my_list:
total += element
print(total)
number = int(input("Enter a number: "))
while number % 2 == 0:
print("The number is even.")
number = int(input("Enter another number: "))
print("The number is odd.")
for ($i = 1; $i <= 10; $i++) {
echo $i . "<br>";
}
1
2
3
4
5
6
7
8
9
10