Hi! I'm trying to make two circles next to each other, but I got some issues. Someone recommended me to try a code visualizer, and it helped me understanding things more! However, I still don't fully get the problem and I'd like to ask for some help!
It does its thing beautifully, but at the end it says the return value is none. Could that be the issue? If so, how can I fix it? Thank you!!
import math
def balls(radius):
# empty grid
grid = [[' ' for x in range(radius * 4)] for y in range(radius * 2)]
for y in range(radius * 2):
for x in range(radius * 4):
centre = (x - radius) ** 2 + (y - radius) ** 2
if radius >= centre:
grid[y][x] = 'x'
print(grid)
radius = int(input("Choose your size: "))
balls(radius)```