python联盟是什么意思_创建和显示联盟标签的Python代码

我是一个新的编码和实践,我正在努力创建一个联盟表,一个友好的板球联盟在我的大学。该表将随着联赛的进展而更新。但是我还想保留一个选项来检查具有不同列的表排名,但是每次我尝试检查站姿时,它都会返回null表。在#function that calculates various parameters

def net_rr(n,i):

result = input('Won(w)/Lost(l)/Draw(d):')

if (result == 'w') or (result == 'l') or (result == 'd'):

if result == 'w':

Table[i][2] += 1

Table[i][5] += (3*Table[i][2])

elif result == 'l':

Table[i][3] += 1

Table[i][5] += 0*Table[i][3]

elif result == 'd':

Table[i][4] += 1

Table[i][5] += 1*Table[i][4]

Table[i][0] = n

Table[i][1] += 1

bat_score = float(input('batting score:'))

ovrs_played = float(input('over batted:'))

opp_score = float(input('opponent score:'))

opp_over = float(input('opponent over:'))

runs_scored = [0,0,0,0,0,0]

over_batted = [0,0,0,0,0,0]

runs_conceded = [0,0,0,0,0,0]

overs_bowled = [0,0,0,0,0,0]

runs_scored[i] += bat_score

over_batted[i] += ovrs_played

runs_conceded [i] += opp_score

overs_bowled [i] += opp_over

For = runs_scored[i] / over_batted[i]

Against = runs_conceded [i] / overs_bowled [i]

NRR = For - Against

Table[i][6] = NRR

for row in Table:

print(row)

print('\n')

#main code which asks user input whether he wants to update('Entry') or just check the standings ('Check')

def table( ):

Table = [['Name','Played','Won','Lost','Draws','Points','Net_RR'],['Team1',0,0,0,0,0,0],['Team2',0,0,0,0,0,0],['Team3',0,0,0,0,0,0],['Team4',0,0,0,0,0,0],['Team5',0,0,0,0,0,0],['Team6',0,0,0,0,0,0]]

q = input('what do you want to do:')

if q == 'Entry':

n = input('Name:')

if n == 'Team1':

i = 1

elif n == 'Team2':

i = 2

elif n == 'Team3':

i = 3

elif n == 'Team4':

i = 4

elif n == 'Team5':

i = 5

elif n == 'Team6':

i = 6

net_rr(n,i)

elif q == 'Check':

for row in Table:

print(row)

print('\n')

我希望每次我想检查站姿时都会显示更新的表,但它总是显示空表:

运行table()得到以下输出:

^{pr2}$

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值