<filename>Physics Electric Field Simulator REBUILD.py
import turtle
import random
import math
from math import sqrt


wn = turtle.Screen()
wn.bgcolor("black")
wn.tracer(0)
i =0
n_elec = 0

elec = [] #List of turtles / List of electrons

print("Numer of electrons: "), 
n_elec = int(input())

for _ in range(n_elec): #Change the number to simulate more or less electrons
  elec.append(turtle.Turtle()) #Crea los electrones 

colors = ["green", "blue", "yellow", "red", "magenta", "purple", "orange", "white"] #Color Random Electrones
numbers = [-5, -4, -3, -2, -1, 1, 2, 3, 4, 5] #Velocidad Random Electrones


for j in elec: #Para cada electron añado las siguientes propiedades
  j.shape("circle") #Todos los electrones tienen forma circular
  j.color(random.choice(colors)) # Random color
  #j.penup()
  j.speed(0)
  x = random.randint(-250, 250) # Random Posicion
  y = random.randint(-250, 250) # Random Posicion
  j.goto(x,y)
  j.vx = random.choice(numbers) # Random Velocidad
  j.vy = random.choice(numbers) # Random Velocidad
  j.vfx= 0
  j.vfy= 0
  j.vux=0
  j.vuy=0
  vux =0
  vuy=0
  c = 5 #carraga electron

turtle.color('White')
style = ('Courier', 20, 'italic')
turtle.write('Electron Interaction Simulator', font=style, align='center')
turtle.hideturtle()

while True:
  wn.update()
  for se in elec:
    for e in elec:
      if (sqrt((((se.xcor() - e.xcor()))**2)+(((se.ycor() - e.ycor()))**2))) != 0:
      
        se.dx = se.xcor() - e.xcor()
        se.dy = se.ycor() - e.ycor()
        se.dt = (sqrt(((se.dx)**2)+((se.dy)**2)))
        f = 10*(c*c)/((se.dt)**2)
        se.vux += (se.dx/se.dt)*f
        se.vuy += (se.dy/se.dt)*f


    se.vfx= (105*(se.vux)) + se.vx
    se.vfy= (105*(se.vuy)) + se.vy
    se.sety(se.ycor() + se.vfy)
    se.setx(se.xcor() + se.vfx)

    se.vux = 0
    se.vuy = 0

    if se.ycor() < -250:
      se.vy = se.vy*(-1)
      se.sety(-250)

    if se.ycor() > 250:
      se.vy = se.vy*(-1)
      se.sety(250)
      print("Cambio y > 250")

    if se.xcor() > 250:
      se.vx = se.vx*(-1)
      se.setx(250)
      print("Cambio x > 250")

    if se.xcor() < -250:
      se.vx = se.vx*(-1)
      se.setx(-250)
      print("Cambio x < -250")

  


wn.mainloop()
<filename>Physics Electric Field Simulator REBUILD.py
import turtle
import random
import math
from math import sqrt


wn = turtle.Screen()
wn.bgcolor("black")
wn.tracer(0)
i =0
n_elec = 0

elec = [] #List of turtles / List of electrons

print("Numer of electrons: "), 
n_elec = int(input())

for _ in range(n_elec): #Change the number to simulate more or less electrons
  elec.append(turtle.Turtle()) #Crea los electrones 

colors = ["green", "blue", "yellow", "red", "magenta", "purple", "orange", "white"] #Color Random Electrones
numbers = [-5, -4, -3, -2, -1, 1, 2, 3, 4, 5] #Velocidad Random Electrones


for j in elec: #Para cada electron añado las siguientes propiedades
  j.shape("circle") #Todos los electrones tienen forma circular
  j.color(random.choice(colors)) # Random color
  #j.penup()
  j.speed(0)
  x = random.randint(-250, 250) # Random Posicion
  y = random.randint(-250, 250) # Random Posicion
  j.goto(x,y)
  j.vx = random.choice(numbers) # Random Velocidad
  j.vy = random.choice(numbers) # Random Velocidad
  j.vfx= 0
  j.vfy= 0
  j.vux=0
  j.vuy=0
  vux =0
  vuy=0
  c = 5 #carraga electron

turtle.color('White')
style = ('Courier', 20, 'italic')
turtle.write('Electron Interaction Simulator', font=style, align='center')
turtle.hideturtle()

while True:
  wn.update()
  for se in elec:
    for e in elec:
      if (sqrt((((se.xcor() - e.xcor()))**2)+(((se.ycor() - e.ycor()))**2))) != 0:
      
        se.dx = se.xcor() - e.xcor()
        se.dy = se.ycor() - e.ycor()
        se.dt = (sqrt(((se.dx)**2)+((se.dy)**2)))
        f = 10*(c*c)/((se.dt)**2)
        se.vux += (se.dx/se.dt)*f
        se.vuy += (se.dy/se.dt)*f


    se.vfx= (105*(se.vux)) + se.vx
    se.vfy= (105*(se.vuy)) + se.vy
    se.sety(se.ycor() + se.vfy)
    se.setx(se.xcor() + se.vfx)

    se.vux = 0
    se.vuy = 0

    if se.ycor() < -250:
      se.vy = se.vy*(-1)
      se.sety(-250)

    if se.ycor() > 250:
      se.vy = se.vy*(-1)
      se.sety(250)
      print("Cambio y > 250")

    if se.xcor() > 250:
      se.vx = se.vx*(-1)
      se.setx(250)
      print("Cambio x > 250")

    if se.xcor() < -250:
      se.vx = se.vx*(-1)
      se.setx(-250)
      print("Cambio x < -250")

  


wn.mainloop()
#List of turtles / List of electrons #Change the number to simulate more or less electrons #Crea los electrones #Color Random Electrones #Velocidad Random Electrones #Para cada electron añado las siguientes propiedades #Todos los electrones tienen forma circular # Random color #j.penup() # Random Posicion # Random Posicion # Random Velocidad # Random Velocidad #carraga electron