{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "1cd006d9", "metadata": {}, "outputs": [], "source": [ "from turtle import * \n", "\n", "def initturtle():\n", " \n", " pencolor('blue')\n", "\n", " speed('slowest')\n", "\n", " tracer(1)\n", "\n", " goto(0,0)\n", "\n", " pendown()\n", "\n", "\n", "def graphword(str):\n", "\n", " for char in str:\n", "\n", " if char == 'F':\n", " \n", " forward(100)\n", " \n", " \n", " if char == '-':\n", " \n", " left(90)\n", "\n", "\n", "initturtle()\n", "\n", "graphword('F-F-F-F-')\n", "\n", "done()" ] }, { "cell_type": "code", "execution_count": null, "id": "b8ea7482", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }