def cycle_print(max_iterations: int, iteration_number: int, text: str) -> None:
for i in range(max_iterations):
if i % iteration_number == 0 and i != 0:
text = text.replace("%i%", str(i))
print(text)
else:
print(i)
cycle_print(10, 9, "This is %i% iteration.")
0
1
2
3
4
5
6
7
8
This is 9 iteration.
class Entity {
private static array $ids = [];
private static int $currentId = 0;
private int $id;
public function __construct() {
$this->id = self::$currentId++;
self::$ids[] = $this->id;
}
public function getId(): int {
return $this->id;
}
public function setId(int $id): bool {
if ($id < 0 || isset(self::$ids[$id])) {
return false;
}
unset(self::$ids[$this->id]);
self::$ids[] = $id;
$this->id = $id;
return true;
}
}
data = "гол 25кк".split()
if len(data) > 0:
command = data[0]
data.pop(0)
if len(data) == 1:
if command.lower() == "гол":
value_data = data[0].split('к')
value = int(value_data[0])
value_data.pop(0)
chars_k = len(value_data)
print(command)
print(value)
print(chars_k * "к")
гол
25
кк
$string = "abcdefhgjktyu";
$count = 5;
$rand = "";
for ($i = 0; $i < $count; $i++) {
$rand .= $string[mt_rand(0, strlen($string) - 1)];
}
$numbers = 2;
for ($i = 0; $i < 14; $i++)
{
$numbers .= mt_rand(0, 9);
}
$l_1 = ($numbers[0] * 2) >= 10 ? ($numbers[0] * 2) - 9 : $numbers[0] * 2;
$l_2 = ($numbers[2] * 2) >= 10 ? ($numbers[2] * 2) - 9 : $numbers[2] * 2;
$l_3 = ($numbers[4] * 2) >= 10 ? ($numbers[4] * 2) - 9 : $numbers[4] * 2;
$l_4 = ($numbers[6] * 2) >= 10 ? ($numbers[6] * 2) - 9 : $numbers[6] * 2;
$l_5 = ($numbers[8] * 2) >= 10 ? ($numbers[8] * 2) - 9 : $numbers[8] * 2;
$l_6 = ($numbers[10] * 2) >= 10 ? ($numbers[10] * 2) - 9 : $numbers[10] * 2;
$l_7 = ($numbers[12] * 2) >= 10 ? ($numbers[12] * 2) - 9 : $numbers[12] * 2;
$l_8 = ($numbers[14] * 2) >= 10 ? ($numbers[14] * 2) - 9 : $numbers[14] * 2;
$str = $l_1 + $l_2 + $l_3 + $l_4 + $l_5 + $l_6 + $l_7 + $l_8;
$str = $str + $numbers[0] + $numbers[2] + $numbers[4] + $numbers[6] + $numbers[8] + $numbers[10] + $numbers[12] + $numbers[14];
$l = 0;
for (; ($str % 10) !== 0; $str++) $l++;
$numbers .= $l;