229 button (nextcord.ui.Button): The button that was clicked.
230 interaction (nextcord.Interaction): The interaction that triggered the button click.
231 """
232 dealer_total = self.blackjack.stand()233 result = self.blackjack.check_winner()
234
235 await self.handle_bet_result(interaction, result)
57 pos: tuple,
58 color: str = "#97A8CB",
59 ) -> int:
60 width, height = draw.textbbox((0, 0), text_str, font=font)[2:4] 61 rect_w, rect_h = width + 2 * x_pad, 24 + 2 * y_pad
62 x, y = pos
63 rect_bbox = (x, y, x + rect_w, y + rect_h)
28
29async def check_websocket(url):
30 try:
31 async with websockets.connect(url) as websocket:32 print(f"connected to {url}")
33 return True
34 except Exception as e:
57 pos: tuple,
58 color: str = "#97A8CB",
59 ) -> int:
60 width, height = draw.textbbox((0, 0), text_str, font=font)[2:4] 61 rect_w, rect_h = width + 2 * x_pad, 24 + 2 * y_pad
62 x, y = pos
63 rect_bbox = (x, y, x + rect_w, y + rect_h)
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
def update():
for _ in range(10):
time.sleep(0.01)
display_result()