How to improve a for loop with selection

What should I change in what I posted to create the zero's as you do ?
FAQ: How to do a minimal reproducible example ( reprex ) for beginners

1 Like