python之简单排序和随机整数

#coding:utf-8
import random

i = 0
list1 = []
while i <= 10:
    list1.append(random.randint(10, 100))
    i += 1
print(list1)

list1.sort()
print(list1)

list2 = range(0, 199, 2)

searchkey = int(input('Enter integer search key:'))

if searchkey in list2:
    print('found at index:', list2.index(searchkey))
else:
    print('value not found!')

end!

原文地址:https://www.cnblogs.com/changbo/p/5634153.html