Today, we created a snake game. Most of the code was guided so I will not be posting any code today.
Still on Day 46 Turtle Race Code: from turtle import Turtle, Screen import random screen = Screen() screen.setup( width = 500 , height = 400 ) start = False user_bet = screen.textinput( title = "Make Your Bet" , prompt = "Which turtle will win the race? Enter a color: " ) colors = [ "red" , "orange" , "yellow" , "green" , "blue" , "purple" ] all_turtles = [] for color in colors: maddy = Turtle( shape = "turtle" ) maddy.color(color) maddy.penup() maddy.goto(- 240 , - 100 + colors.index(color) * 40 ) all_turtles.append(maddy) if user_bet: start = True while start: for turtle in all_turtles: if turtle.xcor() > 240 : start = False winning_turtle = turtle.pencolor() if winning_turtle == user_bet: print ( f"You've won! The { winning_turtle } turtle is the winner!" ) else : ...