Machine Learning Program
Maybe you should check validity of the input and ask again if input is wrong?
while baseData[&quot;collecting&quot;]:
  baseData[&quot;x&quot;].append(float(input(&quot;X:&quot;)))

This is always True, so just discard this part:
if len(baseData[&quot;x&quot;]) == len(baseData[&quot;y&quot;]):

Maybe you should give an option to exit?
while True:
  data = input(&quot;X/Data:&quot;)
  print(int(data)-median)

And in general, calling this a &quot;machiene-learning thing&quot; is quite a stretch of imagination, no? Maybe you should have a look at how to fit data. I.e. a basic linear model fit.