diff --git a/.DS_Store b/.DS_Store index 5008ddf..2b61ada 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Lesson_15_16_Example.ipynb b/Lesson_15_16_Example.ipynb new file mode 100644 index 0000000..f204f13 --- /dev/null +++ b/Lesson_15_16_Example.ipynb @@ -0,0 +1,88 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Пример с очисткой экрана" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from IPython.display import clear_output\n", + "\n", + "while True:\n", + " print('Hello')\n", + " clear_output(wait=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Пример с выводом случайного числа" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import random\n", + "\n", + "print(random.randint(0, 10)) #Вывод случайного целого числа из диапазона от 0 до 10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Пример таймера " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "\n", + "start_time = int(time.time())\n", + "timer = 10\n", + "\n", + "while int(time.time()) < start_time + timer:\n", + " print(start_time + timer - int(time.time()))\n", + " time.sleep(1)\n", + " \n", + "print('Конец таймера')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}