-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from pr1ncegupta/olympic-logo
Added [Olympic-Rings-logo] 🚀
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,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) |
This file contains 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,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() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.