Skip to content

Instantly share code, notes, and snippets.

@scandiumby
Last active September 22, 2022 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scandiumby/a77d2001b2188c969c7cf3f33b27d316 to your computer and use it in GitHub Desktop.
Save scandiumby/a77d2001b2188c969c7cf3f33b27d316 to your computer and use it in GitHub Desktop.
Lesson 22.09.22
## 1. Python - высокоуровневый язык программирования общего назначения с динамической строгой типизацией и
автоматическим управлением памятью.
## 2. Python поддерживает следующие парадигмы программирования:
- императивное,
- процедурное,
- структурное,
- объектно-ориентированное,
- метапрограммированиe
- функциональное программирование
- аспектно-ориентированное
## 3. Интерпритатор Python
https://adw0rd.com/2009/08/22/python-howto-work/
https://adw0rd.com/media/2009/08/python.png
## 4
## 5. Старшинство опреаторов в Python
Google: operator precendence python
https://docs.python.org/3/reference/expressions.html#operator-precedence
## Задание1. Какой результат будет в каждой строке кода?
def func_true():
print(“I am telling the truth”)
return True
def func_false():
print(“I am lying”)
return False
1. True + True
2. 1 or 0
3. 1 and 0
4. 10 + 0 or 11
5. 2 * 0 and 2
6. 5 * False and 10
6. 10 * (0 or 2)
7. [] or {}
8. [] and {}
9. [1,2,3] and 1
10. [1,2,3] or 0
11. [] and {1} or 55 and 66
12. [] and ( {1} or 55 ) and 66
13. func_true() and func_false()
14. func_true() or func_false()
15. func_false or func_true()
16. func_true() and func_false
## Дополнние1. Пример выполнения кода разным способом (импорт модуля или всегда):
print ("Always executed")
if __name__ == "__main__":
print ("Executed when invoked directly")
else:
print ("Executed when imported")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment