pygame if event type code example
Example: pygame.event.get() in pygame
for event in pygame.event.get():
if event.type == pygame.QUIT:
# Close the program any way you want, or troll users who want to close your program.
raise SystemExit