diff --git a/Turtle-a-thon/Olympic_Logo/Readme.md b/Turtle-a-thon/Olympic_Logo/Readme.md new file mode 100644 index 0000000..a8a6460 --- /dev/null +++ b/Turtle-a-thon/Olympic_Logo/Readme.md @@ -0,0 +1,16 @@ +# Olympic Rings with Python Turtle + +Author: Prince Gupta +GitHub: [https://github.com/pr1ncegupta](https://github.com/pr1ncegupta) + +This Python program uses the Turtle graphics library to draw the Olympic rings. It creates a window with a white background and draws the iconic Olympic rings in blue, black, red, yellow, and green colors. The rings are positioned according to the Olympic symbol. + +## Instructions +1. Make sure you have Python installed on your computer. +2. You can run the program by copying and pasting the provided code into a Python file. +3. Run the Python script, and it will open a window displaying the Olympic rings. +4. Click within the window to close it. + +Enjoy the gif of the Olympic rings created with Python Turtle graphics! + +![Olympic Rings](olympic_rings.gif) diff --git a/Turtle-a-thon/Olympic_Logo/olympic_logo.py b/Turtle-a-thon/Olympic_Logo/olympic_logo.py new file mode 100644 index 0000000..84fa121 --- /dev/null +++ b/Turtle-a-thon/Olympic_Logo/olympic_logo.py @@ -0,0 +1,27 @@ +import turtle + +# Set up the Turtle screen +screen = turtle.Screen() +screen.bgcolor("white") + +# Create a Turtle object +olympics = turtle.Turtle() +olympics.pensize(6) + +# Define the Olympic ring colors and positions +ring_colors = ["blue", "black", "red", "yellow", "green"] +ring_positions = [(-120, 0), (0, 0), (120, 0), (-60, -60), (60, -60)] + +# Draw the Olympic rings +for color, position in zip(ring_colors, ring_positions): + olympics.penup() + olympics.color(color) + olympics.goto(position) + olympics.pendown() + olympics.circle(60) + +# Hide the Turtle +olympics.hideturtle() + +# Keep the window open until the user clicks +screen.exitonclick() \ No newline at end of file diff --git a/Turtle-a-thon/Olympic_Logo/olympic_rings.gif b/Turtle-a-thon/Olympic_Logo/olympic_rings.gif new file mode 100644 index 0000000..a924cdc Binary files /dev/null and b/Turtle-a-thon/Olympic_Logo/olympic_rings.gif differ