import pygame as py

py.init()
screen = py.display.set_mode((200, 200))
clock  = py.time.Clock()

surface = py.Surface((50 , 50), py.SRCALPHA)
surface.fill((0, 0, 0))
rotated_surface = surface
rect = surface.get_rect()
angle = 0

is_running = True
while is_running:
    for event in py.event.get():
        if event.type == py.QUIT:
            is_running = False

    screen.fill((255, 255, 255))
    angle += 5
    rotated_surface = py.transform.rotate(surface, angle)
    rect = rotated_surface.get_rect(center = (100, 100))
    screen.blit(rotated_surface, (rect.x, rect.y))

    py.display.update()
    clock.tick(30)

py.quit()