【发布时间】:2011-03-08 21:49:59
【问题描述】:
我从谷歌应用引擎开始,正在尝试一些快速学习。我偶然发现了这个问题,这在我的本地开发环境中不会发生。这里是代码
import random, math
random.seed()
quotesArray=[]
quotesArray.append("This is a Test1")
quotesArray.append("This is a Test2")
quotesArray.append("This is a Test3")
quotesArray.append("This is a Test4")
quotesArray.append("This is a Test5")
x = int(math.floor(random.random()*343)+1)
print quotesArray[0]+" "+str(x)
在我的开发环境中,输出是
This is a Test1 45
在现场的输出是
45
谁能告诉我为什么会这样?
【问题讨论】:
-
当您使用 logging.debug() 而不是打印时,是否也会发生这种情况?
标签: python arrays google-app-engine random