Your task is to return the number of visible dots on a die after it has been rolled(that means the total count of dots that would not be touching the table when rolled)

6, 8, 10, 12, 20 sided dice are the possible inputs for "numOfSides" 

topNum is equal to the number that is on top, or the number that was rolled.

for this exercise, all opposite faces add up to be 1 more than the total amount of sides
  Example: 6 sided die would have 6 opposite 1, 4 opposite 3, and so on.
for this exercise, the 10 sided die starts at 1 and ends on 10.

Note: topNum will never be greater than numOfSides

Difficulty: introductory

Starter code:

def totalAmountVisible(topNum, numOfSides):
	

Solutions:
def totalAmountVisible(topNum, numOfSides):
    return numOfSides*(numOfSides+1)/2-(numOfSides-topNum+1)


totalAmountVisible=lambda n,s:s*~-s//2-1+n

def totalAmountVisible(top, sides):
    return sides * (sides + 1 ) / 2 + top - sides - 1

def totalAmountVisible(topNum, numOfSides):
    return numOfSides*(numOfSides-1)//2+topNum-1


def totalAmountVisible(top, sides):
    return (sides - 1) * sides // 2 + top - 1

def totalAmountVisible(n, s):
    return s//2*(s+1)-(s+1-n)


totalAmountVisible = lambda t,n: sum(range(1,n+1))-(n+1-t)

def totalAmountVisible(topNum, numOfSides):
    return sum(range(1, numOfSides + 1)) - (numOfSides - topNum + 1)



def totalAmountVisible(n, s):
    return (s*(s+1))//2 -(s-n+1)


def totalAmountVisible(n,sides):
    return sides*(1+sides)//2-(sides+1-n)