#9.用代码画国旗
# author : mom
import turtle
turtle.up()
turtle.goto(-200,200)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("red")
turtle.pencolor("red")
for i in range(2):
turtle.forward(280)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.end_fill()
turtle.up()
turtle.goto(-170,145)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-100,180)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-70,160)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-70,120)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-100,100)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
4.用户登录程序,只有登录界面哈!
dict1={}
def log():
global dict1
print("|---新建用户:新建---|")
print("|---账户登录:登录---|")
print("|---退出程序:退出---|")
what=input("|---请输入指令代码:")
if what=='新建' or what=='新建' :
key=input("请输入用户名:")
while key in dict1 :
key=input("此用户名已经被使用,请重新输入")
value=input("请输入密码:")
dict1[key]=value
print("注册成功,赶紧试试登陆把^_^")
elif what=='登录' or what=='登录':
key=input("请输入用户名:")
while key not in dict1:
key=input("您输入的用户名不存在,请重新输入")
value=input("请输入密码:")
if(dict1[key]==value):
print("欢迎进入胯下痛系统,请点击右上角的X结束程序!")
else:
print("密码错误")
def SetupClock(radius):
#建立表的外框
reset()
pensize(7)
for i in range(60):
Skip(radius)
if i % 5 == 0:
forward(20)
Skip(-radius-20)
else:
dot(5)
Skip(-radius)
right(6)
2507447895
发表于 2019-11-4
评论列表
加载数据中...
34
发表于 2019-11-4
评论列表
加载数据中...
jincanc
发表于 2019-11-4
评论列表
加载数据中...
bmcker
发表于 2019-11-6
for i in range(2,101,2):
print(i)
评论列表
加载数据中...
蓝原柚子
发表于 2019-10-31
评论列表
加载数据中...
cykablyat
发表于 2019-10-31
评论列表
加载数据中...
2196695799
发表于 2019-10-31
评论列表
加载数据中...
rage_
发表于 2019-10-31
评论列表
加载数据中...
70093137
发表于 2019-11-2
评论列表
加载数据中...
a10232114
发表于 2019-11-2
评论列表
加载数据中...
1602001417
发表于 2019-11-2
评论列表
加载数据中...
15011848035
发表于 2019-11-3
评论列表
加载数据中...
零祎
发表于 2019-11-3
#pylint:disable=C0305
#判断生肖
shengxiao='猴鸡狗猪鼠牛虎兔龙蛇马羊'
import time
#print(shengxiao[0])
#从第0开始输出
#print(shengxiao[0:3])
#运行出前三个
#print(shengxiao[-1])
#当其为负则从后面开始输出
a=input('输入出生年份:')
nf=int(a)
time.sleep(0.51)
b=input('输入出生月份:')
time.sleep(0.51)
c=input('输入出生日期:')
time.sleep(0.5)
print('你的出生日期为:'+a+'年'+b+'月'+c+'日')
time.sleep(0.5)
print('你的生肖为:')
print(shengxiao[nf%12])
#以上判断用户生肖
评论列表
加载数据中...
442813017
发表于 2019-11-3
评论列表
加载数据中...
916074607
发表于 2019-11-3
评论列表
加载数据中...
shizheng
发表于 2019-11-3
评论列表
加载数据中...
人生何处不青山
发表于 2019-11-3
评论列表
加载数据中...
xiaxiao1361
发表于 2019-11-3
评论列表
加载数据中...
blom
发表于 2019-11-3
评论列表
加载数据中...
cwllife
发表于 2019-11-4
评论列表
加载数据中...
3287162506
发表于 2019-11-4
评论列表
加载数据中...
wanwan
发表于 2019-11-4
评论列表
加载数据中...
teqin
发表于 2019-11-4
评论列表
加载数据中...
likun123
发表于 2019-10-30
py也可以写。不过不好实现。
评论列表
加载数据中...
2112079130
发表于 2019-10-30
评论列表
加载数据中...
1223805374
发表于 2019-10-30
评论列表
加载数据中...
3028387185
发表于 2019-10-30
评论列表
加载数据中...
1904631772
发表于 2019-10-30
评论列表
加载数据中...
2370984421
发表于 2019-10-30
这是代码:
from tkinter import *
mygui = Tk(className="百度经验")
#text=text(width=30,height=3)
#btn=Button()
#btn['text']='登录'
#btn.pack()
#text.peck()
#mainloop()
mymenu=Menu()
mymenu.add_command(label="open")
mymenu.add_command(label="ger")
mymenu.add_command(label="data")
mygui.config(menu=mymenu)
mainloop()
评论列表
加载数据中...
朱元璋
发表于 2019-10-30
评论列表
加载数据中...
良家少男1337
发表于 2019-10-30
评论列表
加载数据中...
amir
发表于 2019-10-30
评论列表
加载数据中...
hjp2426
发表于 2019-10-30
可以交个朋友。
评论列表
加载数据中...
blakc
发表于 2019-10-30
你可以看一下我发过的帖子。
评论列表
加载数据中...
jklly123
发表于 2019-10-30
评论列表
加载数据中...
rage_
发表于 2019-10-31
评论列表
加载数据中...
老板大气尸体健康嗷
发表于 2019-10-31
# author : mom
import turtle
turtle.up()
turtle.goto(-200,200)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("red")
turtle.pencolor("red")
for i in range(2):
turtle.forward(280)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.end_fill()
turtle.up()
turtle.goto(-170,145)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-100,180)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-70,160)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-70,120)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-100,100)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
turtle.forward(20)
turtle.right(144)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
评论列表
加载数据中...
3030023031
发表于 2019-10-31
import time
print('你好,我是Python,欢迎你来和我做朋友
评论列表
加载数据中...
1134469363
发表于 2019-10-31
a='k'#赋值
if a=='k':#相等,if为判断条件,冒号 缩进
print('此用户顺利过关')
print('他是智障,所有人都为他悲哀')
else:#否则
print('此用户未过关')
#意思就是用if判断变量a的内容是否=b,如果等于就输出第3段代码,不相等就输出第5段代码
评论列表
加载数据中...
985046801
发表于 2019-10-31
评论列表
加载数据中...
sunyujun
发表于 2019-10-31
评论列表
加载数据中...
白兮
发表于 2019-10-31
评论列表
加载数据中...
jklly123
发表于 2019-10-28
score = int(input('请输入您的分数:'))
if 100 > score >= 95:
print('A')
elif 95 > score >= 85:
print('B')
elif 85 > score >= 75:
print('C')
elif 75> score >= 60:
print('D')
else:
print('输入错误')
评论列表
加载数据中...
1241185295
发表于 2019-10-29
start=1
while True:
if start==51:
break
print ( start*2)
start +=1
评论列表
加载数据中...
jincanc
发表于 2019-10-29
dict1={}
def log():
global dict1
print("|---新建用户:新建---|")
print("|---账户登录:登录---|")
print("|---退出程序:退出---|")
what=input("|---请输入指令代码:")
if what=='新建' or what=='新建' :
key=input("请输入用户名:")
while key in dict1 :
key=input("此用户名已经被使用,请重新输入")
value=input("请输入密码:")
dict1[key]=value
print("注册成功,赶紧试试登陆把^_^")
elif what=='登录' or what=='登录':
key=input("请输入用户名:")
while key not in dict1:
key=input("您输入的用户名不存在,请重新输入")
value=input("请输入密码:")
if(dict1[key]==value):
print("欢迎进入胯下痛系统,请点击右上角的X结束程序!")
else:
print("密码错误")
elif what=='退出' or what=='退出':
return
while(1):
log()
评论列表
加载数据中...
yukikaze
发表于 2019-10-29
from turtle import *
from datetime import *
def Skip(step):
penup()
forward(step)
pendown()
def mkHand(name, length):
#注册Turtle形状,建立表针Turtle
reset()
Skip(-length*0.1)
begin_poly()
forward(length*1.1)
end_poly()
handForm = get_poly()
#注册Turtle形状命令register_shape(name,shape=None)
register_shape(name, handForm)
def Init():
global secHand, minHand, hurHand, printer
mode("logo")# 重置Turtle指向北
#建立三个表针Turtle并初始化
#第二个参数为长度
mkHand("secHand", 125)
mkHand("minHand", 130)
mkHand("hurHand", 90)
secHand = Turtle()
secHand.shape("secHand")
minHand = Turtle()
minHand.shape("minHand")
hurHand = Turtle()
hurHand.shape("hurHand")
for hand in secHand, minHand, hurHand:
hand.shapesize(1, 1, 3)
hand.speed(0)
#建立输出文字Turtle
printer = Turtle()
printer.hideturtle()
printer.penup()
def SetupClock(radius):
#建立表的外框
reset()
pensize(7)
for i in range(60):
Skip(radius)
if i % 5 == 0:
forward(20)
Skip(-radius-20)
else:
dot(5)
Skip(-radius)
right(6)
def Week(t):
week = ["星期一", "星期二", "星期三",
"星期四", "星期五", "星期六", "星期日"]
return week[t.weekday()]
def Date(t):
y = t.year
m = t.month
d = t.day
return "%s %d %d" % (y, m, d)
def Tick():
#绘制表针的动态显示
#当前时间
t = datetime.today()
second = t.second + t.microsecond*0.000001
minute = t.minute + second/60.0
hour = t.hour + minute/60.0
secHand.setheading(6*second)
minHand.setheading(6*minute)
hurHand.setheading(30*hour)
#介入Tracer函数以控制刷新速度
tracer(False)
printer.forward(65)
printer.write(Week(t), align="center",
font=("Courier", 14, "bold"))
printer.back(130)
printer.write(Date(t), align="center",
font=("Courier", 14, "bold"))
printer.home()
tracer(True)
ontime
评论列表
加载数据中...
112233
发表于 2019-10-29
评论列表
加载数据中...
weewd
发表于 2019-10-29
评论列表
加载数据中...
鸢一折纸
发表于 2019-10-29
评论列表
加载数据中...
1145738769
发表于 2019-10-29
评论列表
加载数据中...
1275246762
发表于 2019-10-29
评论列表
加载数据中...
wuzhiyi
发表于 2019-10-29
评论列表
加载数据中...
15011848035
发表于 2019-10-29
我太难了,我给图片你们慢慢写,这个只适合PC运行。
图1代码
图2运行图
可能图片的效果不是很好,可以留言,
参数论坛有图片文字提取工具,
评论列表
加载数据中...
chuancey
发表于 2019-10-29
评论列表
加载数据中...
yuequan
发表于 2019-10-29
评论列表
加载数据中...
wenrou
发表于 2019-10-29
评论列表
加载数据中...
1223805374
发表于 2019-10-30
评论列表
加载数据中...
145623
发表于 2019-10-30
评论列表
加载数据中...
nlibidd
发表于 2019-10-30
评论列表
加载数据中...
myclass112
发表于 2019-10-30
评论列表
加载数据中...
135124
发表于 2019-10-30
评论列表
加载数据中...
kwp187
发表于 2019-12-30
1111111111
评论列表
加载数据中...
kwp187
发表于 2019-12-30
11111111
评论列表
加载数据中...
16685416494
发表于 2019-12-30
还是看不懂
评论列表
加载数据中...