Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- x = True
- players = []
- height = []
- weight = []
- heightdic = {}
- weightdic = {}
- num = 1
- lh = 1
- lw = 1
- def datain(nt):
- for val in range(nt):
- global lh
- global lw
- valh = int(input("Enter the height of the {} player in cm: ".format(lh)))
- valw = int(input("Enter the weight of the {} player in kg: ".format(lw)))
- lh = lh + 1
- lw = lw + 1
- height.append(valh)
- weight.append(valw)
- weightdic = dict(zip(players, weight))
- heightdic = dict(zip(players, height))
- print(heightdic)
- print(weightdic)
- def values(nt):
- for key in range(nt):
- global num
- pnum = "p" + str(num)
- num = num + 1
- players.append(pnum)
- datain(nt)
- def main():
- global x
- while x == True:
- try:
- nt = int(input("Enter the number of teammates (min. 10): "))
- except ValueError:
- print("You have to enter an integer")
- os.system('read -sn 1 -p "Press any key to continue..."')
- print("\n")
- if nt < 1:
- print("Minimal number of teammates is 10 not, {}".format(nt))
- os.system('read -sn 1 -p "Press any key to continue..."')
- print("\n")
- else:
- values(nt)
- x = False
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement