我试图在洗牌后打印出用户输入列表。而不是打印列表,它打印“无”。我做错了什么?
import random
x = raw_input("Write one word: ")
word1 = x
y = raw_input("Write another word: ")
word2 = y
z = raw_input("Write one more word: ")
word3 = z
all_words = [word1, word2, word3]
random_words = random.shuffle(all_words)
print random_words
答案 0 :(得分:1)
#5 - number of retry, ip[0] - your ip from the array
`ping -q -c 5 #{ip[0]}`
'All is OK' if $?.exitstatus == 0
改变输入列表并返回random.shuffle
。如果您None
,您会看到一个随机播放的列表。