只是審查我即將到來的期中。我們被給予過去的中期問題,但沒有解決方案。我正努力把握最好的知識。Python龜圖形簡化
對於這個問題,它要求定義一個名爲equalSigns的函數,傳遞它的值t和長度。所以,我只需要在烏龜圖形中製作我的程序,創建兩條parellel線,我認爲很簡單。這是我寫的代碼,只是爲了正確輸出x長度的等號。 (當然我會把它轉換成函數)我的問題,有沒有更好的方法來創建這個?
import turtle
t=turtle.Turtle()
s=turtle.Screen()
t.forward(200)
t.penup()
t.home()
t.right(90)
t.forward(50)
t.pendown()
t.left(90)
t.forward(200)
'''i suppose i dont have to go home and then down.
instead just continue and go down and forward left.
but either way, is this the best approach to take?
'''
我出來很好,只是顯得有點不正統,謝謝你我這是我在找什麼! – Ryan