repl.it
@samirbrar/

Fifa player rating calculator

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
pName = input("Enter player name: ")
pos = input("Enter player position [Forward / Midfield / Defense]: ")

paceWeight, shootingWeight, passingWeight, dribblingWeight, defenseWeight, physicalWeight = 0, 0 , 0 , 0 , 0 , 0

if pos == "Forward":
  paceWeight = 0.3
  shootingWeight = 0.25
  passingWeight = 0.1
  dribblingWeight = 0.25
  defenseWeight = 0.03
  physicalWeight = 0.07
elif pos == "Midfield":
  paceWeight = 0.1
  shootingWeight = 0.15
  passingWeight = 0.35
  dribblingWeight = 0.2
  defenseWeight = 0.1
  physicalWeight = 0.1
elif pos == "Defense":
  paceWeight = 0.05
  shootingWeight = 0.05
  passingWeight = 0.1
  dribblingWeight = 0.1
  defenseWeight = 0.4
  physicalWeight = 0.3
else:
  print("Invalid position")
  
if pos == "Forward" or pos == "Midfield" or pos == "Defense":
  pace = int(input("Enter pace: "))
  shooting = int(input("Enter shooting: "))
  passing = int(input("Enter passing: "))
  dribbling = int(input("Enter dribbling: "))
  defending = int(input("Enter defending: "))
  physical = int(input("Enter physical: "))
  
  overall = int(round(pace * paceWeight + shooting * shootingWeight + passing * passingWeight +
  dribbling * dribblingWeight + defending * defenseWeight + physical * physicalWeight))
  
print("\nOverall score for %s: %d" %(pName, overall))