Turtle Race Game :Python Beginner

Helloooo,

I was getting bored and so just started to learn python programming.In the beginning it was all the tutorials i saw which started bouncing back even before reaching my head after a while.But i wanted to learn it so i searched for some interesting python programs and found this one which was fun to do ….i wanted to share it here for all python beginners to make it an interesting topic of learning python

What you need:

1.Python: https://www.python.org/downloads/

2. Pycharm: http://www.jetbrains.com/pycharm/

OR You can do it online in trinket also: https://trinket.io/embed/python/33e5c3b81b#.XPenKRYzZdg

3.Little programming knowledge/basics

Download and install 1 and 2 and you can start programming or directly start doing in trinket

Now lets start programming in python 🙂

Steps:

1.Open Pycharm(shortcut will be available in desktop when you install

2.Open Pycharm select python installed version as interpreter

3. Open New Project and name for the project

4.After creating the project it will appear in the left side of the window. Right click the project name

Select New–>Python File

5.The programming window and console will appear and you can start coding

6.First and the most interesting code you can write is the turtle race game

7.See the code below:you can copy paste and run it

from turtle import*
from random import randint
speed(10)
penup()
goto(-100 , 100)
for step in range(15):
write(step , align ='center')
right(90)
forward(10)
pendown()
forward(150)
penup()
backward(160)
left(90)
forward(20)

ada = Turtle()
ada.color('red')
ada.shape('turtle')
ada.penup()
ada.goto(-150, 80)
ada.pendown()
ada.right(0)
for turn in range(100):

ada.forward(randint(1,5))

bob = Turtle()
bob.color('green')
bob.shape('turtle')
bob.penup()
bob.goto(-150,60)
bob.pendown()
bob.right(360)
for turn in range(100):
bob.forward(randint(1,5))

tut = Turtle()
tut.color('Magenta')
tut.shape('turtle')
tut.penup()
tut.goto(-150,40)
tut.pendown()
for turn in range(100):
tut.forward(randint(1,5))

mut = Turtle()
mut.color('yellow')
mut.shape('turtle')
mut.penup()
mut.goto(-150,20)
mut.pendown()
for turn in range(100):
mut.forward(randint(1,5))




8.Run the program

–:Select the Run button in the right corner of the window or Go to Run menu in menu bar and run the program

9.The output will be fun to watch

Turtle Race Game :Python inspired

For full explanatory vedio,Watch in youtube https://youtu.be/EXeaXrwL6W4

Our first python program is ready……….Enjoy learning and programming

2 responses to “Turtle Race Game :Python Beginner”

  1. […] You can easily draw a circle and make it continuously change its color using a simple python program.Python installation will be familiar to you all or else refer to my previous blog post https://aweigh.family.blog/2019/06/06/turtle-race-game-python-beginner/ […]

    Like

  2. […] Python installation will be familiar to you all or else refer to my previous blog post https://aweigh.family.blog/2019/06/06/turtle-race-game-python-beginner/ […]

    Like

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free