-
-
Notifications
You must be signed in to change notification settings - Fork 126
[TASK] Quiz # 4 (https://github.com/SENATOROVAI/intro-cs/issues/4) #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": 1, | ||
| "id": "a5c7f761", | ||
| "metadata": {}, | ||
| "outputs": [ | ||
| { | ||
| "data": { | ||
| "text/plain": [ | ||
| "'Module for logging experiment results.'" | ||
| ] | ||
| }, | ||
| "execution_count": 1, | ||
| "metadata": {}, | ||
| "output_type": "execute_result" | ||
| } | ||
| ], | ||
| "source": [ | ||
| "\"\"\"Module for logging experiment results.\"\"\"\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "33ff615f", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "04/01\n", | ||
| "1. Закончила выполнение intro, c Cursor разобралась.\n", | ||
| "2. Начала проходить курс по Python.\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "f6cb4978", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "7/01\n", | ||
| "1. Выполнила quiz 1 b quiz 2" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "3ceda156", | ||
| "metadata": {}, | ||
| "source": [] | ||
| } | ||
| ], | ||
| "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.13.11" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 5 | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| """Module for logging experiment results.""" | ||
|
|
||
| # 04/01 | ||
| # 1. Закончила выполнение intro, c Cursor разобралась. | ||
| # 2. Начала проходить курс по Python. | ||
| # | ||
|
|
||
| # 7/01 | ||
| # 1. Выполнила quiz 1 b quiz 2 | ||
|
|
||
| # |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": 1, | ||
| "id": "c1ccfa97", | ||
| "metadata": {}, | ||
| "outputs": [ | ||
| { | ||
| "data": { | ||
| "text/plain": [ | ||
| "'Quiz 4.'" | ||
| ] | ||
| }, | ||
| "execution_count": 1, | ||
| "metadata": {}, | ||
| "output_type": "execute_result" | ||
| } | ||
| ], | ||
| "source": [ | ||
| "\"\"\"Quiz 4.\"\"\"" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "01f96160", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "1. Что такое CPython и чем он отличается от Python?\n", | ||
| "Python - это язык программирования, а CPython - это и язык программирования, и интерпретатор одновременно. \n", | ||
| "3. Сколько существует реализаций Python, и какая из них самая популярная?\n", | ||
| "Существует 6 реализаций Python, самая популярная из них-CPython\n", | ||
| "4. На каком языке написан CPython?\n", | ||
| "CPython написан на языке С.\n", | ||
| "5. (опционально) Кто создал CPython?\n", | ||
| "CPython создал голландский программист Гвидо ван Россум.\n", | ||
| "\n", | ||
| "6. Почему Python считается быстрым, несмотря на то, что это интерпретируемый язык?\n", | ||
| "Потому что ядро CPython написано на языке С, и он вызывает инструкции из С.\n", | ||
| "\n", | ||
| "7. Напишите путь к Интерпретатору CPython на вашем компьютере\n", | ||
| "C:\\Users\\user\\anaconda3\\python.exe\n", | ||
| "\n", | ||
| "8. Что содержится в папке include в CPython?\n", | ||
| "В папке include в CPython находятся заголовочные файлы на языке С.\n", | ||
| "\n", | ||
| "9. Где можно найти исходный код CPython дайте ссылку на репозиторий гитхаб.\n", | ||
| "Ссылка на репозиторий гитхаб: https://github.com/python/cpython\n", | ||
| "\n", | ||
| "10. (опционально) Как работает интерпретатор CPython при выполнении кода?\n", | ||
| "Интерпретатор CPython выполняет код пошагово, преобразуя его в машинные инструкции для компьютера.\n", | ||
| "\n", | ||
| "11. Какая команда используется для запуска файла с помощью CPython?\n", | ||
| "python filename\n", | ||
| "\n", | ||
| "12. Можно ли запускать текстовые файлы через интерпретатор Python? Почему?\n", | ||
| "Можно, так как интерпретатору неважно, какие файлы запускать, главное – валидный пайтон-код.\n", | ||
| "\n", | ||
| "13. Как указать путь к интерпретатору и файлу для выполнения кода?\n", | ||
| "Через абсолютный или относительный путь. \n", | ||
| "\n", | ||
| "14. Чем PyPy отличается от CPython?\n", | ||
| "Этот интерпретатор работает в 10 раз быстрее, чем CPython.\n", | ||
| "\n", | ||
| "15. Почему PyPy не может использоваться для всех проектов на Python?\n", | ||
| "Это достаточно новый интерпретатор, и он ещё не совместим со всеми проектами на Python. \n", | ||
| "\n", | ||
| "16. Где можно скачать PyPy?\n", | ||
| "По ссылке: https://pypy.org/download.html\n", | ||
| "\n", | ||
| "17. Как установить PyPy после скачивания?\n", | ||
| "Извлечь папку и прописать пути в переменных средах.\n", | ||
| "\n", | ||
| "18. Как запустить файл с помощью PyPy?\n", | ||
| "В командной строке Windows ввести абсолютный путь до интерпретатора, пробел, абсолютный путь до файла, нажать Enter.\n", | ||
| "\n", | ||
| "19. Почему PyPy выполняет код быстрее, чем CPython?\n", | ||
| "PyPy использует Just-In-Time компилятор для компиляции Python в машинный код во время выполнения, что ускоряет работу.\n", | ||
| "\n", | ||
| "Практические задания\n", | ||
| "Задание 1: Поиск и установка CPython\n", | ||
| "Проверьте, установлен ли CPython на вашем компьютере:\n", | ||
| " Используйте поиск в меню \"Пуск\" (Windows) или терминале (Linux/Mac).\n", | ||
| " Введите команду python --version или python3 --version в терминале.\n", | ||
| "Если CPython не установлен, скачайте его с официального сайта Python https://www.python.org/downloads/ и установите.\n", | ||
| "\n", | ||
| "C:\\Users\\user>python --version\n", | ||
| "Python 3.13.9\n", | ||
| "\n", | ||
| "\n", | ||
| "Задание 2: Исследование структуры CPython\n", | ||
| "Найдите папку, где установлен Python (например, через команду where python в терминале или свойства ярлыка).\n", | ||
| "Откройте папку include и изучите её содержимое. Какое количество файлов на C там есть?\n", | ||
| "Перейдите на [GitHub-репозиторий CPython](https://github.com/python/cpython) и найдите файл README. Прочитайте информацию о проекте.\n", | ||
| "\n", | ||
| "В папке include количество файлов на C: 77.\n", | ||
| "\n", | ||
| "C:\\Users\\user>where python\n", | ||
| "C:\\Users\\user\\anaconda3\\python.exe\n", | ||
| "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python310\\python.exe\n", | ||
| "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python312\\python.exe\n", | ||
| "C:\\Users\\user\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe\n", | ||
| "\n", | ||
| "C:\\Users\\user>\n", | ||
| "\n", | ||
| "Задание 3: Запуск файла с помощью CPython\n", | ||
| "Создайте текстовый файл example.txt с содержимым:\n", | ||
| "print(\"Hello from CPython!\")\n", | ||
| "Запустите файл через команду python <путь_до_файла> (замените <путь_до_файла> на фактический путь к вашему файлу).\n", | ||
| "Проверьте, что выводится на экран. Попробуйте изменить расширение файла на .py и повторите запуск.\n", | ||
| "C:\\Users\\user>C:\\Users\\user\\anaconda3\\Scripts\\ipython3.exe C:\\Users\\user\\Desktop\\Test1\\example.txt\n", | ||
| "Hello from CPython!\n", | ||
| "\n", | ||
| "C:\\Users\\user>C:\\Users\\user\\anaconda3\\Scripts\\ipython3.exe\n", | ||
| "C:\\Users\\user\\Desktop\\Test1\\example.py\n", | ||
| "Hello from CPython!\n", | ||
| "\n", | ||
| "\n", | ||
| "Задание 4: Установка и использование PyPy\n", | ||
| "Перейдите на [официальный сайт PyPy](https://www.pypy.org/) и скачайте подходящую версию для вашей операционной системы.\n", | ||
| "Распакуйте скачанный архив в удобное место.\n", | ||
| "Создайте файл example_pypy.py с кодом:\n", | ||
| "print(\"Hello from pypy!\")\n", | ||
| "Запустите файл через PyPy\n", | ||
| "pypy <путь_до_файла> (замените <путь_до_файла> на фактический путь к вашему файлу).\n", | ||
| "Проверьте, что выводится на экран. Попробуйте изменить расширение файла на .py и повторите запуск.\n", | ||
| "Вывод:\n", | ||
| "C:\\Users\\user>C:\\Users\\user\\Downloads\\pypy3.11-v7.3.20-win64\\pypy.exe C:\\Users\\user\\Desktop\\Test1\\example_pypy.py\n", | ||
| "Hello from PyPy\n", | ||
| "C:\\Users\\user>\n", | ||
| "Задание 5: Сравнение производительности CPython и PyPy\n", | ||
| "Создайте файл performance_test.py с кодом:\n", | ||
| " import time\n", | ||
| " start_time = time.time()\n", | ||
| " total = 0\n", | ||
| " for i in range(1, 10000000):\n", | ||
| " total += i\n", | ||
| " end_time = time.time()\n", | ||
| " \n", | ||
| " print(\"Result:\", total)\n", | ||
| " print(\"Execution time:\", end_time - start_time, \"seconds\")\n", | ||
| "Запустите этот файл сначала через CPython, а затем через PyPy. Запишите результаты времени выполнения для обоих интерпретаторов.\n", | ||
| "Сделайте вывод о разнице в производительности.\n", | ||
| "\n", | ||
| "Результат запуска через PyPy:\n", | ||
| "C:\\Users\\user>C:\\Users\\user\\Downloads\\pypy3.11-v7.3.20-win64\\pypy.exe C:\\Users\\user\\Desktop\\Test1\\performance_test.py\n", | ||
| "Result: 49999995000000\n", | ||
| "Execution time: 0.015625715255737305 seconds\n", | ||
| "\n", | ||
| "Результат запуска через iPython:\n", | ||
| "C:\\Users\\user>C:\\Users\\user\\anaconda3\\Scripts\\ipython.exe C:\\Users\\user\\Desktop\\Test1\\ performance_test.py\n", | ||
| "Result: 49999995000000\n", | ||
| "Execution time: 2.2144627571105957 seconds\n", | ||
| "Вывод: Время выполнения через интерпретатор iPython в 142 раза больше.\n" | ||
| ] | ||
| } | ||
| ], | ||
| "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.13.11" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 5 | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделай ревью
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отправляй файл расширением .py на проверку, на будущее)