Skip to content

Commit

Permalink
Merge pull request #6 from pr1ncegupta/olympic-logo
Browse files Browse the repository at this point in the history
Added [Olympic-Rings-logo] 🚀
  • Loading branch information
shreyamalogi authored Oct 22, 2023
2 parents 080b209 + 925f35d commit 2ae82db
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Turtle-a-thon/Olympic_Logo/Readme.md
Original file line number Diff line number Diff line change
@@ -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)
27 changes: 27 additions & 0 deletions Turtle-a-thon/Olympic_Logo/olympic_logo.py
Original file line number Diff line number Diff line change
@@ -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()
Binary file added Turtle-a-thon/Olympic_Logo/olympic_rings.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2ae82db

Please sign in to comment.