repl.it
@AlexanderHall4/

biodiversity simpsons index 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
while True:
  try:
    b = []
    numer = 0
    c = 0
    a = input("enter values seperated by space:").split(" ")
    for i in range(len(a)):
      b.append(int(a[i]))
      c += b[i]
      numer += (b[i])*(b[i] - 1)
    denom = c*(c-1)
    print(str(numer/denom))
  except:
    pass
?