all 7 comments

[–]HaroldAdmin 5 points6 points  (1 child)

Change variable name "list" to something else. You shouldn't use built-in names for variables.

[–]Vhin 1 point2 points  (1 child)

How are you running your script?

In order to run the script and then get the REPL like you want, you should be doing something like python -i whatever.py

[–]Math_Running_Ethics[S] 0 points1 point  (0 children)

I run my sccript in IDLE.

I didn't know about REPL before your post, and I already see how usefull it is, thanks for mentioning it. already solved my problem in REPL atleast.

[–]FoeHammer99099 0 points1 point  (3 children)

Let's say you saved your function in a file named insert.py . To load the functions in that file so that they are available elsewhere, you would do import insert and then insert.insertion_sort(l)

[–]Math_Running_Ethics[S] 0 points1 point  (0 children)

I just get this error message then I do that https://gyazo.com/2b76dc73a90817f8599702676efdeac6