'''
@Author: your name
@Date: 2020-07-24 15:40:09
@LastEditTime: 2020-07-24 16:02:29
@LastEditors: Please set LastEditors
@Description: In User Settings Edit
@FilePath: \vscode_py\day18.py
'''
# Hints
# random.sample(l,5) 返回一个list
# random.choice(l) 返回一个值
# Question 70
# Please write a program to output a random even number between 0 and 10 inclusive using random module and list comprehension.
import random
def Q70():
l=[i for i in range(0,11,2)]
ans=random.choice(l)
print(ans)
# Question 71
# random.choice()输出随机的数字
def Q71():
l=[i for i in range(10,151) if i%35==0]
ans=random.choice(l)
print(ans)
# Question 72
# Please write a program to generate a list with 5 random numbers between 100 and 200 inclusive.
def Q72():
# ans=random.sample([i for i in range(100,201)],5)
ans=random.sample( range(100,201),5)
print(ans)
# Question 73
# Please write a program to randomly generate a list with 5 even numbers between 100 and 200 inclusive.
def Q73():
l=[i for i in range(100,201) if i %2==0]
ans=random.sample(l,5)
print(ans)
# Question 74
# Please write a program to randomly generate a list with 5 numbers, which are divisible by 5 and 7 , between 1 and 1000 inclusive.
def Q74():
l=[i for i in range(1,1001) if i % 5==0 and i%7==0]
ans=random.sample(l,5)
print(ans)
if __name__ == "__main__":
# Q70()
# Q71()
# Q72()
# Q73()
Q74()