import random def generate_random_number(start, end): return random.randint(start, end)
示例输入
start = 1 end = 100
调用函数并打印结果
random_number = generate_random_number(start, end) print("生成的随机整数为:", random_number)
标签:并打印,end,python,random,number,start,generate From: https://blog.51cto.com/u_16058927/7124069