Add Python notes
This commit is contained in:
3
python/модули/from.py
Executable file
3
python/модули/from.py
Executable file
@@ -0,0 +1,3 @@
|
||||
#Можно подключить только 1 функцию из модуля
|
||||
from random import randint as random
|
||||
print(random(1,20))
|
||||
16
python/модули/модули.py
Executable file
16
python/модули/модули.py
Executable file
@@ -0,0 +1,16 @@
|
||||
#Подключение модуля, связанного с математикой
|
||||
import math
|
||||
#as позволяет в будущем использовать модуль при помощи псевдонима
|
||||
import random as r
|
||||
|
||||
|
||||
|
||||
#вывод числа e
|
||||
print(math.e)
|
||||
#вывод числа пи
|
||||
print(math.pi)
|
||||
#вывод косинуса
|
||||
print(math.cos(30))
|
||||
|
||||
|
||||
print(r.randint(0, 20))
|
||||
Reference in New Issue
Block a user