标签:div logs red print span images 技术分享 分享 size
五角星:
from turtle import * for i in range(5): forward(100) right(144)
同心圆:
from turtle import* for i in range(5): up() goto(0,-20*(i)) down() circle(20*i)
太阳花:
from turtle import * color(‘red‘,‘yellow‘) begin_fill() while True: forward(200) left(170) if(abs(pos()))<1: break end_fill() done()
国旗:
from turtle import * setup(600,400,0,0) color("yellow") bgcolor("red") fillcolor("yellow") def zuobiao(x,y): up() goto(x,y) down() def long5 (r): begin_fill() for i in range(5): forward(r) right(144) end_fill() zuobiao(-250,95) long5(90) zuobiao(-150,180) long5(60) zuobiao(-100,130) long5(60) zuobiao(-100,50) long5(60) zuobiao(-150,0) long5(60)
钻石太阳花:
from turtle import * color("red") speed(10) def a (): forward(100) left(45) forward(100) left(135) for i in range(36): a() a() right(10) pensize(10) right(90) forward(400)
学号:
n = input("请输入学号:") #201406114327 print("年级为:{}级".format(n[2:4])) print("专业为:{}".format(n[4:10])) print("学号为:{}号".format(n[10:]))
星期:
s = "星期一星期二星期三星期四星期五星期六星期日" #03 36 69 912 n =int(input("请输入数字(1-7):")) if (0 < n <8): print(s[((n-1)*3):(n*3)]) else : print("输入错误")
身份证:
n=input("请输入身份证:") #44068119960412101 print("{}省{}市{}县".format(n[:2],n[2:4],n[4:6])) print("生日为:{}年{}月{}日".format(n[6:10],n[10:12],n[12:14])) s=n[16] if s%2==0: print("性别为:女") else: print("性别为:男")
标签:div logs red print span images 技术分享 分享 size
原文地址:http://www.cnblogs.com/hzl123/p/7514145.html