一道python題求大神回答感激不盡

2021-03-04 01:35:45 字數 2055 閱讀 6967

1樓:匿名使用者

def link_zip(s,t):

p=pairnode(s.a,t.a,none)s1,t1,p1=s.nxt,t.nxt,p.nxtwhile s1 and t1:

p1=pairnode(s1.a,t1.a,none)s1,t1,p1=s1.nxt,t1.nxt,p1.nxt

怎麼用python畫玫瑰花,求大神貼**,感激不盡

2樓:匿名使用者

import turtle

# 設定初始位置

turtle.penup()

turtle.left(90)

turtle.fd(200)

turtle.pendown()

turtle.right(90)

# 花蕊

turtle.fillcolor("red")turtle.begin_fill()

turtle.circle(10, 180)turtle.circle(25, 110)turtle.left(50)

turtle.circle(60, 45)turtle.circle(20, 170)turtle.right(24)

turtle.fd(30)

turtle.left(10)

turtle.circle(30, 110)turtle.fd(20)

turtle.left(40)

turtle.circle(90, 70)turtle.circle(30, 150)turtle.right(30)

turtle.fd(15)

turtle.circle(80, 90)turtle.left(15)

turtle.fd(45)

turtle.right(165)

turtle.fd(20)

turtle.left(155)

turtle.circle(150, 80)turtle.left(50)

turtle.circle(150, 90)turtle.end_fill()

# 花瓣1

turtle.left(150)

turtle.circle(-90, 70)turtle.left(20)

turtle.circle(75, 105)turtle.setheading(60)turtle.

circle(80, 98)turtle.circle(-90, 40)# 花瓣2

turtle.left(180)

turtle.circle(90, 40)turtle.circle(-80, 98)turtle.setheading(-83)# 葉子1

turtle.fd(30)

turtle.left(90)

turtle.fd(25)

turtle.left(45)

turtle.fillcolor("green")turtle.begin_fill()

turtle.circle(-80, 90)turtle.right(90)

turtle.circle(-80, 90)turtle.end_fill()

turtle.right(135)

turtle.fd(60)

turtle.left(180)

turtle.fd(85)

turtle.left(90)

turtle.fd(80)

# 葉子2

turtle.right(90)

turtle.right(45)

turtle.fillcolor("green")turtle.begin_fill()

turtle.circle(80, 90)turtle.left(90)

turtle.circle(80, 90)turtle.end_fill()

turtle.left(135)

turtle.fd(60)

turtle.left(180)

turtle.fd(60)

turtle.right(90)

turtle.circle(200, 60)執行結果:

一道python的題,求大神幫忙

usr bin python coding utf 8 occur file open hw6 problem 6.txt lines list line for line in file.readlines for line in lines for character in line if ch...

關於python的一道題,求大神解答

回inputfile open filename,r 答dict word count if inputfile none print error unable to read file filename return else for line in inputfile line line.str...

python的一道題求解,一道python題,求解,。。

有幾個問bai題,少冒號,然du后里面的j不需要zhi加一,還有就是daoprint要放到回迴圈中 縮排有答問題 i 0 for j in range 1,1001 if j 20 0 i 1 print i,j for那一行缺少冒號。if那一行要用 號。print括號內不需要end的那一部分。20...