Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import math
  2. class exo2(object):
  3. """description of class"""
  4. def __init__(self, nb1, nb2):
  5. self.nbq = nb1
  6. self.nbc = nb2
  7.  
  8. def calcul(self):
  9. chanceWinNbc = 1/self.nbc
  10. chanceLossNbc = 1- chanceWinNbc
  11. questionWin = int(round((60*self.nbq) /100))
  12. questionLoss = self.nbq - questionWin
  13. total = math.pow(chanceWinNbc,questionWin) + math.pow(chanceLossNbc,questionLoss)
  14.  
  15. return total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement