<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>
<DIV>
<DIV><FONT size=2>Hello!</FONT></DIV>
<DIV><FONT size=2> I have a question about python's dictionary,I have a
dictionary type variable,</FONT></DIV>
<DIV><FONT size=2>such as </FONT></DIV>
<DIV><FONT size=2><FONT face=System size=1><FONT
color=#0000ff>dbs={'xk.dhs.org': '166.111.177.77',
'www.symantec.com':'202.112.237.39', <FONT
size=2>'ftp.happynet.org':'166.111.160.7'}</FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=2>When I input
dbs['www.symantec.com']='202.112.237.15',</FONT><FONT size=2>I want to get the
result like that:</FONT></DIV>
<DIV><FONT face=System color=#0000ff
size=1>dbs={'xk.dhs.org': '166.111.177.77',
'www.symantec.com':['202.112.237.39','202.112.237.15'],'ftp.happynet.org':'166.111.160.7'}</FONT></DIV>
<DIV><FONT size=2>How to realize this function? </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>When I input dbs['www.symantec.com']='202.112.237.39',how to
determine if this item has exists in dbs,if item has existed, the result is
still like this:</FONT></DIV>
<DIV><FONT face=System color=#0000ff size=1>
<DIV><FONT face=System color=#0000ff
size=1>dbs={'xk.dhs.org': '166.111.177.77',
'www.symantec.com':['202.112.237.39','202.112.237.15'],'ftp.happynet.org':'166.111.160.7'}</FONT></DIV>
<DIV><FONT face=ËÎÌå color=#000000 size=2>if item doesn't exist,then insert new
value into dbs,How to realize this function?</FONT></DIV>
<DIV><FONT face=ËÎÌå color=#000000 size=2></FONT> </DIV><FONT face=ËÎÌå
color=#000000 size=2>When I print dbs,I like the result as
follows: </FONT> </FONT></DIV>
<DIV><FONT face=System color=#0000ff
size=1>'xk.dhs.org': '166.111.177.77'</FONT></DIV>
<DIV><FONT face=System color=#0000ff
size=1>'www.symantec.com':'202.112.237.39'</FONT></DIV>
<DIV><FONT face=System color=#0000ff
size=1>'www.symantec.com':'202.112.237.15'</FONT></DIV>
<DIV><FONT color=#0000ff><FONT face=System
size=1>'ftp.happynet.org':'166.111.160.7'</FONT></FONT></DIV>
<DIV><FONT face=System size=2> <FONT face=ËÎÌå>How to realize these
function?</FONT></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
Thanks!</FONT></DIV></DIV></DIV></BODY></HTML>