Skip to content

Instantly share code, notes, and snippets.

@Eserthesay
Created May 25, 2020 14:07
Show Gist options
  • Save Eserthesay/97c20812a1ee9d249ac2e29975cc3475 to your computer and use it in GitHub Desktop.
Save Eserthesay/97c20812a1ee9d249ac2e29975cc3475 to your computer and use it in GitHub Desktop.
list_ex1=[1,5,7,-10,12,14,-16,-8,0]
pos=[]
neg=[]
neg.append(list_ex1[0]) if list_ex1[0]<0 else pos.append(list_ex1[0])
neg.append(list_ex1[1]) if list_ex1[1]<0 else pos.append(list_ex1[1])
neg.append(list_ex1[2]) if list_ex1[2]<0 else pos.append(list_ex1[2])
neg.append(list_ex1[3]) if list_ex1[3]<0 else pos.append(list_ex1[3])
neg.append(list_ex1[4]) if list_ex1[4]<0 else pos.append(list_ex1[4])
neg.append(list_ex1[5]) if list_ex1[5]<0 else pos.append(list_ex1[5])
neg.append(list_ex1[6]) if list_ex1[6]<0 else pos.append(list_ex1[6])
neg.append(list_ex1[7]) if list_ex1[7]<0 else pos.append(list_ex1[7])
neg.append(list_ex1[8]) if list_ex1[8]<0 else pos.append(list_ex1[8])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment