Job Scheduling Algorithm 2
'algorithm' is not correct at all and will fail at runtime. please make sure your code works before posting it. start and end are never read. time is never defined. 'row' is never defined--it is typo-d as 'job_row' the second time. use 'for job in robs', not 'for job_row in range(len(jobs)) together with 'jobs[job_row]'. I would generally recommend a linter, which should catch all these errors.

Add a docstring to &quot;algorithm&quot;, describing what its inputs are, and what it returns. Make sure to describe what it returns in terms of MEANING, and not what the algorithm does. (&quot;returns the best way to schedule...&quot; and not &quot;loops through...&quot;)
Change the name of 'algorithm' to reflect what it does (ex. 'schedule').

I personally think it's fine to put the contents of 'main' directly in the if __name__ == &quot;__main__&quot; block, but I've seen it both ways.

For the output_ methods, consider returning a string, and printing the string, as two steps. &quot; &quot;.join() may help.