This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Операции, операторы и инструкции | |
## Пример кода | |
Инструкция импортирует переменную pi из модуля math. | |
from math import pi | |
Позиционное присваивание значений глобальным переменным. | |
x, y, z = [1, 2, 3] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 1. Python - высокоуровневый язык программирования общего назначения с динамической строгой типизацией и | |
автоматическим управлением памятью. | |
## 2. Python поддерживает следующие парадигмы программирования: | |
- императивное, | |
- процедурное, | |
- структурное, | |
- объектно-ориентированное, | |
- метапрограммированиe | |
- функциональное программирование |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import string | |
class CharIterator: | |
def __init__(self): | |
self.pos = 0 | |
def __aiter__(self): | |
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
english_goals = { | |
"a": "Free communication with colleagues and customers", | |
"b": "I want to become an IT specialist", | |
"c": "Easy to read documentation in English", | |
"d": "I don't need to learn English", | |
"e": "Make a choice instead of me", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AutoInc: | |
current_index = 0 | |
def __call__(self): | |
self.current_index += 1 | |
return self.current_index | |
def append_to_list(alist: list): | |
alist.append(7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EJCounter: | |
counter = 0 | |
def __init__(self): | |
EJCounter.counter += 1 | |
def __str__(self): | |
return f'{self.__class__.__name__} was called {self.counter} time' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in_list = [1, 2, 3, 4, 5] | |
out_list = list(map(lambda x: (x + 1) if x % 2 == 0 else x, in_list)) | |
print(out_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Author: Egor N. Kostyuk | |
* Date: 06.02.2018 | |
* Time: 15:35 | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function get_meta_template($params){ | |
$tmp = "\n\r"; | |
$tmp .= '<!-- '.$this->plugin_name.' v '.$this->plugin_version.' -->'; | |
$tmp .= "\n"; | |
if ($params['description']){ | |
$tmp .= '<meta name="description" content="'.$params['description'].'" />'; | |
$tmp .= "\n"; | |
} |