octopusList = {"first": ["red", "white"],
"second": ["green", "blue", "red"],
"third": ["green", "blue", "red"]}
squidList = ["first", "second", "third"]
for i in range(1):
squid = random.choice(squidList)
octopus = random.choice(octopusList[squid])
print squid + " " + octopus
任何人都可以帮助我用JavaScript写这篇文章吗?我已经将我的大部分程序写入了JavaScript,但是具体如何获得列表以及使用JavaScript编写的列表让我感到困惑。我一般都是新手,所以谢谢你提出我的问题。 :D将Python翻译成JavaScript - 列表?
+1为头节点 – Cole 2010-07-16 03:40:37