python做积分_python做个积分器

热乎乎的积分器做好了!才34行代码,别忘了保存再运行!

完整代码:

from tkinter.messagebox import*

from tkinter.simpledialog import*

from tkinter import*

window = Tk()

window.title('计分器')

a = '0'

b = '0'

c = '0'

d = '0'

frame = Frame(window)

frame.pack()

game = 1

while game <= 35:

game = game + 1

a_score1 = askinteger(title = '给A加分:', prompt = '给A加分:')

b_score1 = askinteger(title = '给B加分:', prompt = '给B加分:')

c_score1 = askinteger(title = '给C加分:', prompt = '给C加分:')

d_score1 = askinteger(title = '给D加分:', prompt = '给D加分:')

an = 'a方'

bn = 'b方'

cn = 'c方'

dn = 'd方'

#p = '局的分数'

a = a + a_score

b = b + b_score

c = c + c_score

d = d + d_score

showinfo(an,a_score1)

showinfo(bn,b_score1)

showinfo(cn,c_score1)

showinfo(dn,d_score1)

if game > 35:

showwarning('Error!','局数不能超过35!')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值