from random import randint
li=[randint(-100,100) for i in range(10)]
li_ch=[]
li_otr=[]
li_nechotr=[]
for i in li:
if i%2==0:
li_ch.append(str(i))
elif i<0:
li_otr.append(str(i))
elif i%2!=0 and i>0:
li_nechotr.append(str(i))
print(', '.join(li_ch))
print(', '.join(li_otr))
print(', '.join(li_nechotr))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
from random import randint
li=[randint(-100,100) for i in range(10)]
li_ch=[]
li_otr=[]
li_nechotr=[]
for i in li:
if i%2==0:
li_ch.append(str(i))
elif i<0:
li_otr.append(str(i))
elif i%2!=0 and i>0:
li_nechotr.append(str(i))
print(', '.join(li_ch))
print(', '.join(li_otr))
print(', '.join(li_nechotr))