import random import sys import pandas as pd import math import printout import csv global n,spin,stake, total_stake, win, all_dict,cost,alls,profit,nn,ddf nn=0 total_stake=[] alls=[] nms=[] nos_list=[0,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] #bet_list=[0.25,0.25,0.25,0.25,0.33,0.33,0.33,0.5,0.5,1,2] bet_list=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] all_dict=dict(zip(nos_list,bet_list)) #cost=sum(all_dict.values()) #print(cost) f = open('Tue1.csv', 'a') def winner(spin): print("Win",36*all_dict[spin]) profit=36*all_dict[spin]-sum(alls) print("Profit",profit) if profit>0: nms.append(profit) nms.append(profit) f = open('Tue1.csv', 'a',encoding='utf8') writer = csv.writer(f) writer.writerow(nms) f.close() sys.exit() else: gg=sum(all_dict.values()) all_dict[spin]=all_dict[spin]+nn gg=sum(all_dict.values()) print(all_dict,gg) # ff={37:200}###################### # all_dict.update(ff)################# maximum = max(all_dict, key=all_dict.get) # Just use 'min' instead of 'max' for minimum. print(maximum, all_dict[maximum]) dtd=all_dict[maximum] print(dtd*36,profit) if profit<-20: #print("trsesseerrrrrrrrrrrrrrrrrr") print("Loss=",profit) nms.append(profit) f = open('Tue1.csv', 'a',encoding='utf8') writer = csv.writer(f) writer.writerow(nms) f.close() print(spin,"Stop Loss") sys.exit() alls.clear() alls.append(-profit) for xx in range(200): spin=random.randint(0, 36) print(spin) gg=sum(all_dict.values()) alls.append(gg) print("Cost",sum(alls)) #print(spin) if spin>0 and spin<37: nn=nn+1 winner(spin) print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++") # df = pd.DataFrame(dict) # # saving the dataframe # df.to_csv('file1.csv')