2 added 1 character in body edited Aug 12 at 5:04 axsvl77 50733 silver badges1616 bronze badges By far the simplest way is to do it in two lines: a = Table[RandomReal[], {n, 10}]]; a[[1 ;; 3]] = b; a[[7 ;; 10]] = b; a  This gives the output: {b, b, b, 0.378846, 0.475894, 0.533768, b, b, b, b} By far the simplest way is to do it in two lines: a = Table[RandomReal[], {n, 10}] a[[1 ;; 3]] = b; a[[7 ;; 10]] = b; a  This gives the output: {b, b, b, 0.378846, 0.475894, 0.533768, b, b, b, b} By far the simplest way is to do it in two lines: a = Table[RandomReal[], {n, 10}]; a[[1 ;; 3]] = b; a[[7 ;; 10]] = b; a  This gives the output: {b, b, b, 0.378846, 0.475894, 0.533768, b, b, b, b} 1 answered Aug 12 at 1:54 axsvl77 50733 silver badges1616 bronze badges By far the simplest way is to do it in two lines: a = Table[RandomReal[], {n, 10}] a[[1 ;; 3]] = b; a[[7 ;; 10]] = b; a  This gives the output: {b, b, b, 0.378846, 0.475894, 0.533768, b, b, b, b}