So, I've looked all over the internet and I've seen a few things that state
window_width, window_height = pygame.display.get_surface().get_size()
is possible but when I do it I get an error message (window_width = pygame.display.get_surface().get_size() AttributeError: 'NoneType' object has no attribute 'get_size') I've seen it's possible here and well as other sites so why won't it work for me?
import pygame
import random
window_width, window_height = pygame.display.get_surface().get_size()
black = (0,0,0)
close_program = False
fullscreen = False
white = (255,255,255)
random_position_x = random.randint(0, window_width)
random_position_y = random.randint(0, window_height)