Онлайн компилятор Python

historique = "2-1,1-0,0-2,3-1,1-1,2-2,0-1,2-0,1-2,3-2,1-1,0-0,2-1,1-3,2-2,1-0,2-1,3-0,1-1,2-1" scores = [s.strip() for s in historique.split(',')] buts = [] for s in scores: a,b = map(int, s.split('-')) buts.append(a+b) total = len(buts) over15 = sum(1 for x in buts if x>1.5)/total*100 over25 = sum(1 for x in buts if x>2.5)/total*100 print(f"Over 1.5: {over15:.0f}%") print(f"Over 2.5: {over25:.0f}%") if over25 >= 60: print("JOUE OVER 2.5") else: print("JOUE OVER 1.5 SAFE")
The code parses a string of match scores, computes the total goals per match, and calculates the percentage of matches with more than 1.5 and more than 2.5 goals. It then prints these percentages and decides which bet to play based on whether the over 2.5 percentage is at least 60.

- Check the comparison thresholds: goals are integers, so comparing to 1.5 and 2.5 works, but think about whether "over 1.5" should mean 2 or more goals and "over 2.5" should mean 3 or more.
- Look at the final decision logic: it only checks over25, but consider whether the over15 value should also influence the choice, and whether the printed percentages match the intended meaning.