I followed a tutorial for a python snake game and it threw me a bunch of errrors when i typed it in

import tkinter as tk
from tkinter import messagebox
import random

GAME_WIDTH = 700
GAME_HEIGHT = 700
SPEED = 50
SPACE_SIZE = 50
BODY_PARTS = 3
SNAKE_COLOR = "#00FF00"
FOOD_COLOR = "#FF0000"
BACKGROUND_COLOR = "#000000"

class Snake:
    pass

class Food:
    pass

def next_turn():
    pass

def change_direction(new_direction):


window = Tk()
window.title("Snake")
window.resizable(False, False)

score = 0
direction = "down"

label = label(windowm text="score:{}". format(score), font="(consolas)", 40)
label.pack()

window.mainloop()

I really am confused as im only 5 minutes in the tutorial.

What errors are you getting?

I do see a bunch of places where there can be compiler errors:

  1. You imported tkinter as tk, so use tk.Tk() (not Tk()), label = label(… should be tk.Label(…)
  2. You’re currently calling a variable named label. windowm, which is a typo, Change to → window.

3. font=“(consolas)”, 40 is invalid — font takes a tuple like (“Consolas”, 40).

You should add more info here so folks can help out.