Here is my code:
from numpy import random p_10=1.12*10**(-7) Rate = 0.3 Wealth = 20 * 10**6 n=0 Losses = 0 while n <10**8 and Wealth>0: n+=1 a = r