Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Deleting from Lists' topicStudent Support Forum > General > "Deleting from Lists"

Next Comment >Help | Reply To Topic
Author Comment/Response
Beth
08/30/07 11:27pm

I have plenty of experience working with lists, but this has me stuck. I have a list, pbpts, which is global. This section of code is in a function I've defined:

Print[pbpts];
Delete[pbpts, pt];
Append[pbpts, {x2, y2}];
Print[x2];
Print[y2];
Print[pbpts];

When I call the function, with pt=1, this is the output:

{{-1,0},{0,-1},{Sqrt[3]/2,1/2}}
-0.521516
0.462285
{{-1,0},{0,-1},{Sqrt[3]/2,1/2}}

I don't understand why my list is unchanged?? Why would Delete and Append have no effect?
Does anyone have any ideas?

Thank you!

URL: ,

Subject (listing for 'Deleting from Lists')
Author Date Posted
Deleting from Lists Beth 08/30/07 11:27pm
Re: Deleting from Lists yehuda ben-s... 09/01/07 2:56pm
Re: Deleting from Lists Peter Pein 09/02/07 03:42am
Next Comment >Help | Reply To Topic