import pygame
import sys

# Initialize Pygame
pygame.init()

# Set up some constants
WIDTH, HEIGHT = 640, 480
BALL_RADIUS = 10
PADDLE_WIDTH, PADDLE_HEIGHT = 100, 20
PADDLE_SPEED = 5
BALL_SPEED = 3

# Set up some colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)

# Set up the display
screen = pygame.display.set_mode((WIDTH, HEIGHT))

# Set up the font
font = pygame.font.Font(None, 36)

# Set up the ball
ball_x, ball_y = WIDTH / 2, HEIGHT / 2
ball_dx, ball_dy = BALL_SPEED, -BALL_SPEED

# Set up the paddle
paddle_x, paddle_y = WIDTH / 2, HEIGHT - PADDLE_HEIGHT - 20

# Game loop
while True:
    # Handle events
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

    # Move the paddle
    keys = pygame.key.get_pressed()
    if keys[pygame.K_LEFT]:
        paddle_x -= PADDLE_SPEED
    if keys[pygame.K_RIGHT]:
        paddle_x += PADDLE_SPEED

    # Move the ball
    ball_x += ball_dx
    ball_y += ball_dy

    # Bounce the ball off the walls
    if ball_x < 0 or ball_x > WIDTH:
        ball_dx = -ball_dx
    if ball_y < 0:
        ball_dy = -ball_dy

    # Check for collision with the paddle
    if ball_y + BALL_RADIUS > paddle_y and ball_x > paddle_x and ball_x < paddle_x + PADDLE_WIDTH:
        ball_dy = -ball_dy

    # Draw everything
    screen.fill(BLACK)
    pygame.draw.circle(screen, WHITE, (int(ball_x), int(ball_y)), BALL_RADIUS)
    pygame.draw.rect(screen, WHITE, (paddle_x, paddle_y, PADDLE_WIDTH, PADDLE_HEIGHT))

    # Update the screen
    pygame.display.flip()
    pygame.time.Clock().tick(60)



실행해 봐라 잘 된다. 난 파이썬 코드 작성할 줄 모름