#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!
时间: 2024-10-17 04:53:08