<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Need help with a python function' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Need help with a python function' posted on the 'Python' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 20:28:51 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 20:28:51 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Need help with a python function</title>
      <link>http://www.programmersheaven.com/mb/python/429854/429854/need-help-with-a-python-function/</link>
      <description>I have a function that draws a star (this works) and I have to call that function a certain amount of times, given by the input. The colors of the stars have to be generated randomly, the length of each side of the star has to be generated randomly, and the placing (x,y) coordinate of the star. In other words, I have to make a bunch of differently sized, different color stars scattered around the page. Here is what I have and I keep getting a type error saying the type 'int' has no len().&lt;br /&gt;
&lt;br /&gt;
FOR DRAWING THE STAR&lt;br /&gt;
&lt;br /&gt;
def star(color,length,x,y):&lt;br /&gt;
    turtle.penup()&lt;br /&gt;
    turtle.color(color)&lt;br /&gt;
    turtle.goto(x,y)&lt;br /&gt;
    turtle.forward(length)&lt;br /&gt;
    turtle.pendown()&lt;br /&gt;
    count = 0&lt;br /&gt;
    while (count &amp;lt; 5):&lt;br /&gt;
        turtle.forward(length)&lt;br /&gt;
        turtle.right(144)&lt;br /&gt;
        turtle.forward(length)&lt;br /&gt;
        count +=1&lt;br /&gt;
print (star("black",50,200,-100))&lt;br /&gt;
&lt;br /&gt;
FOR DRAWING SEVERAL STARS&lt;br /&gt;
&lt;br /&gt;
def color():&lt;br /&gt;
    Question = int(input("How many stars do you want? "))&lt;br /&gt;
    count = 0&lt;br /&gt;
    while (count &amp;lt; Question):&lt;br /&gt;
        rnum = randrange(0,5)&lt;br /&gt;
        if (rnum == 0):&lt;br /&gt;
            turtle.color("red")&lt;br /&gt;
        elif (rnum == 1):&lt;br /&gt;
            turtle.color("blue")&lt;br /&gt;
        elif (rnum == 2):&lt;br /&gt;
            turtle.color("yellow")&lt;br /&gt;
        elif (rnum == 3):&lt;br /&gt;
            turtle.color ("green")&lt;br /&gt;
        else:&lt;br /&gt;
            turtle.color("black")&lt;br /&gt;
        turtle.penup()&lt;br /&gt;
        x = randrange(-280,280)&lt;br /&gt;
        y = randrange(-200,200)&lt;br /&gt;
        turtle.goto(x,y)&lt;br /&gt;
        turtle.pendown()&lt;br /&gt;
        turtle.color(rnum)&lt;br /&gt;
        rnum2 = randrange(5,70)&lt;br /&gt;
        turtle.forward(rnum2)&lt;br /&gt;
        count += 1&lt;br /&gt;
        print (star)&lt;br /&gt;
print (color())&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/429854/429854/need-help-with-a-python-function/</guid>
      <pubDate>Tue, 16 Oct 2012 17:38:12 -0700</pubDate>
      <category>Python</category>
    </item>
  </channel>
</rss>