On Line " if ar[i]>element: " the array "ar" is never created as a variable ,hence the error.
Also " count=count+1" will generate error as variable count not defined
finally, " temp=a[i]" will be an error ,you can figure this one