I am trying to write a quicksort program in python, however I'm getting an invalid syntax error at else statement
in the second last line below:
import random
n=int(raw_input("Enter the size of the list: ")) # size of the list
intlist = [0]*n
for num in range(n):
intlist[num]=random.randint(0,10*n)
pivot=random.choice(intlist)
list_1=[] # list of elements smaller than pivot
list_2=[] # list of elements greater than pivot
for num in range(n):
if num<=pivot:
list_1.append(num)
else
list_2.append(num)
This is not a complete program as I am still writing.