# VBForums CodeBank > CodeBank - Other >  [Python] Star Generator

## dday9

*Description:*
This is a very simple star or asterisk pyramid generator using Python 3.3.2. It uses the command prompt, similar to Visual Basic.Net's console application.


*Notes:*
You can easily convert this to compile with Python 2, just change input() to raw_input()


*Plans:*
I plan to properly parse the numeric datatypes. Currently I'm just using int([string]), which is fine if the user enters in a numeric data type, but if the user enters in a non-numeric character then it will crash the program.


*Source:*

Python Code:
#This generates the stars
def gen_stars(i):
    #Start off with a blank string
    stars = ""
    #Loop from 0 to i
    for up in range(0, i + 1):
        #Add a * and print it
        stars += "*"
        print (stars)
        
    #Loop from i to 0
    for down in range(i, 0, -1):
        #Remove the last character of stars and print what we got
        stars = stars[:-1]
        print (stars)
    
 while True == True:
    #Get the input, I put 1 - 78 b/c 78 is the furthest it'll go without word wrap screwing it up
    i = int(input("Please enter in a number from 1 - 78: "))
    if i > 0 and i <= 78:
        gen_stars(i)
        print ()
    else:
        print ("Invalid Input.")

----------

