Coding Global Background
Coding Global

School Project help

Archiviert 2 years ago
3 Nachrichten
0 Mitglieder
2 years ago
In Discord öffnen
K
kwics
Verified

I need help with updating the scoreboard every time 1 number in the game is higher then the other. Here is the code: !pip install random import random rand_list = [] n = 10 for i in range(n): rand_list.append(random.randint(1, 13)) print(rand_list) print(random.choice(rand_list)) rand_list1 = [] n = 10 for i in range(n): rand_list1.append(random.randint(1, 13)) print(rand_list1) print(random.choice(rand_list1)) if rand_list1 > rand_list: print(f"The second deck wins!") if rand_list > rand_list1: print(f"The first deck wins!") def update_scoreboard(home_score, away_score): return f"{home_score} - {away_score}" scoreboard = update_scoreboard(0, 0) home_score = 0 away_score = 0 scoreboard = update_scoreboard(home_score, away_score) print(scoreboard)

Antworten (3)