求问怎样用python/python turtle画“心”
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了求问怎样用python/python turtle画“心”相关的知识,希望对你有一定的参考价值。
参考技术A from turtle import *def curvemove():for i in range(200):
right(1)
forward(1)color('red','pink') begin_fill()left(140)forward(111.65)curvemove()left(120)curvemove()forward(111.65)end_fill()done()本回答被提问者采纳
python基础--元组
#元祖 只读列表,可循环查询,可切片。
#儿子不能改,孙子可能可以改。
# tu = (1,2,3,‘alex‘,[2,3,4,‘taibai‘],‘egon‘)
# # print(tu[3])
# # print(tu[0:4])
# # for i in tu:
# # print(i)
# tu[4][3]=tu[4][3].upper()
# print(tu)
# tu[4].append(‘sb‘)
# print(tu)
# s = ‘alex‘
# s1 = ‘sb‘.join(s)
# print(s1)
#列表转化成字符串 list -----> str join
# li = [‘taibai‘,‘alex‘,‘wusir‘,‘egon‘,‘女神‘,]
# s = ‘++++‘.join(li)
#str ----->list split()
# print(s)
#range [1,2,3,4,5,6,.......100........]
# for i in range(3,10):
# print(i)
# for i in range(10):
# print(i)
# for i in range(0,10,3):
# print(i)
# for i in range(10,0,-2):
# print(i)
# for i in range(10,-1,-2):
# print(i)
li = [1,2,3,5,‘alex‘,[2,3,4,5,‘taibai‘],‘afds‘]
# for i in li:
# if type(i) == list:
# for k in i:
# print(k)
# else:print(i)
for i in range(len(li)):
if type(li[i]) == list:
for j in li[i]:
print(j)
else:print(li[i])
以上是关于求问怎样用python/python turtle画“心”的主要内容,如果未能解决你的问题,请参考以下文章
新手用pycharm出现了这些问题,求问是怎么回事啊,怎么改
萌新Python温度转换程序if TempStr【-1】 in [‘F’,‘f’]报错,错误显示为【-1】这块,求问原因?