# -*- coding: utf-8 -*- """ Created on Mon Oct 26 13:17:52 2015 @author: md316445 """ import random as r N = 10 pacjenci = [i for i in range(N)] print(pacjenci) maska = [r.random()>0.75 for i in range(N)] print (maska) pacjencinowy = [p for m, p in zip(maska, pacjenci) if m] pacjencistary = [p for m, p in zip(maska, pacjenci) if not m] print (pacjencinowy) print (pacjencistary)