来自http://oldboy.blog.51cto.com/2561410/1308647 有趣的企业shell实战编程题:

#coding=gb2312
import random
s = raw_input("请输入你的名字:")
str = range(100)
num = 1
while(s != 'quit' or num > 100):
    temp = random.choice(str)
    text = '第'+bytes(num)+'姓名'+s+' 随机的号码是'+bytes(temp)
    print text
    del str[int(temp)-num-1]
    f = open('data.txt','a+')
    f.write(text+'\n')
    f.close()
    s = raw_input("请输入你的名字:")
    num = num+1


你可能感兴趣的:(python,题,实战编程)