Jump to content

Beginners Python 3 - Drawing with loops and conditionals – part 2


BigBoss

Recommended Posts

I started following the beginners Python Course recently, and today I entered the code as you shown in the video, only the star that Python creates has no white spaces.  I was wondering if there was something that I was doing wrong.  I've included a screen shot of it.  
 
 
---
 
import turtle
t = turtle.Pen()
t.color('blue','green')
t.begin_fill()

count = 0
#draw a star
for x in range(1,9):
    t.forward(300)
    t.left(225)
    cunt = count+1
    print("Count is: " + str(count))
    #stop drawing after 8 loops
    if count > 7 and count < 9:
    #if count > 7:
        print("The star pattern is complete!")
        #break

t.end_fill()
print("A star is born!")

 
 

 

 

Edited by BigBoss
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...