使用Python的turtle模块
```python
import turtle
def draw_heart(x, y, size):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
turtle.begin_fill()
turtle.left(140)
turtle.forward(224 * size)
for i in range(200):
turtle.right(1)
turtle.forward(2 * size)
turtle.left(120)
for i in range(200):
turtle.right(1)
turtle.forward(2 * size)
turtle.forward(224 * size)
turtle.end_fill()
turtle.speed(0)
turtle.bgcolor('black')
turtle.penup()
turtle.goto(0, -200)
turtle.pendown()
draw_heart(0, 0, 1)
turtle.done()
```
使用Python的matplotlib库
```python
import numpy as np
import matplotlib.pyplot as plt
def draw_heart():
t = np.linspace(0, 2 * np.pi, 1000)
x = 16 * np.sin(t)3
y = 13 * np.cos(t) - 5 * np.cos(2 * t) - 2 * np.cos(3 * t) - np.cos(4 * t)
plt.figure(figsize=(8, 6))
plt.plot(x, y, color='red')
plt.title('Heart Shape')
plt.axis('equal')
plt.show()
draw_heart()
```
使用HTML和CSS创建爱心形状
```html