In [ ]:
%%html
<style>
.text_cell_render * {
font-family: OfficinaSansCTT;
}
.reveal code {
font-family: OfficinaSansCTT;
}
.text_cell_render h3 {
font-family: OfficinaSansCTT;
}
.reveal section img {
max-height: 500px;
margin-left: auto;
margin-right: auto;
}
</style>
Лучше ВООБЩЕ НИКОГДА не делать "sudo pip install"
Лучше ВООБЩЕ НИКОГДА не делать "sudo pip install"
Подробнее: https://conda.io/docs/user-guide/tasks/manage-environments.html
In [ ]:
%time "list(range(1000000)); print('ololo')"
https://github.com/damianavila/RISE
Прежде чем продолжать, давайте настроим, чтобы она работала у всех
In [ ]:
def my_cool_function(a, b):
return a + b
def my_cool_function2(a: int, b: int) -> int:
return a + b
In [ ]:
def my_cool_function(a, b):
return a + b
my_cool_function2("foo", "bar")
In [ ]:
def main():
# here be dragons
return
if __name__ == "__main__":
main()
In [ ]:
import random # встроенный модуль
import os.path as op # импорт с псевдонимом
In [ ]:
random.randint(1, 10)
In [ ]:
from os.path import *
In [ ]:
from sample2 import fibonacci
In [ ]:
sample2.fibonacci(5)
In [ ]:
import traceback
d = {}
try:
1 / 0
except KeyError as exc:
print(traceback.format_exc())
except ZeroDivisionError as an_exc:
print("bad luck")
In [ ]:
import random
a = [
random.randint(-10, 10)
for _ in range(10)
]
a
In [ ]:
b = [item ** 2 for item in a if item > 0]
In [ ]:
b
In [ ]:
a = "asfdhasdfh"
dir(a)
In [ ]: