<html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><META name="Author" content="Novell GroupWise WebAccess"></head><body style='font-family: Tahoma, sans-serif; font-size: 13px; '>Hi,<br>kind of a newbie here, but I have two questions that are probably pretty simple.<br><br>1.  I need to get rid of duplicate values that are associated with different keys in a dictionary.  For example I have the following code.<br>s={}<br>s[0]=[10,2,3]<br> s[10]=[22,23,24]<br> s[20]=[45,5]<br>s[30]=[2,4]<br>s[40]=[6,7,8]<br><br>Now I want to be able to loop through the primary keys and get rid of duplicates (both in keys and values) so that I would have either a new dictionary or the same dictionary but with the following values:<br><br>s[0]=[3]<br>
 s[10]=[22,23,24]<br>
 s[20]=[45,5]<br>
s[30]=[2,4]<br>
s[40]=[6,7,8]<br><br>It doesn't matter which value gets removed as long as there is only one remaining, so in this example it doesn't matter that 2 got removed from s[0] or from s[30] as long as there is only one 2 in the dictionary.<br><br>2.  I need to be able to loop over the values in the dictionary when there are multiple values assigned to each key like above and assign new values to those values.  Taking the above example I would want to assign a new value so that when you called s[0] it would equal [3,4] say if 4 was the new value.  I think this should be as simple as adding a value, but I kept on having difficulty.<br><br>Any suggestions would be greatly appreciated.<br><br>Thank you very much,<br>Krishna<br></body></html>