## Dashed Line Function
def dashline (length, dashLength):
	beginPos = turtle.pos()
	
	##the remain length of the whole dash line:
	remainlength = length
	
	##set the step number needs to draw the dash line:
	for dashStep in range (0, (length - length % dashLength)/dashLength/2+1):
		print "Dash Step:", dashStep
		
		##draw the dash line
		if remainlength >= dashLength * 2:
			turtle.pendown()
			turtle.forward(dashLength)
			turtle.penup()
			turtle.forward(dashLength)
			##update the remainlength
			remainlength = remainlength - dashLength * 2

		##draw the last step, based on the remain length        
		elif remainlength < dashLength *2:
			turtle.pendown()
			turtle.forward(remainlength)
