Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- part = {{a, b}, {c, d}, {e, f}, {g, h}}
- lenpart=Length[part];
- Do[Which[
- ipart==1,
- Print[part[[ipart]]],
- ipart!=1 && ipart!=lenpart,
- Print[part[[ipart]]],
- ipart==lenpart,
- Print[part[[ipart]]]
- ],{ipart,1,lenpart}];
- Do[Which[
- ipart==First[part],
- Print[ipart],
- ipart!=First[part] && ipart!=Last[part],
- Print[ipart],
- ipart==Last[part],
- Print[ipart]
- ],{ipart,part}];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement