随机写一段python代码
import random
生成一个随机数
x = random.randint(1, 100)
判断随机数是奇数还是偶数
if x % 2 == 0: print("随机数 %d 是偶数" % x) else: print("随机数 %d 是奇数" % x)
原文地址: https://www.cveoy.top/t/topic/CSl 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
import random
x = random.randint(1, 100)
if x % 2 == 0: print("随机数 %d 是偶数" % x) else: print("随机数 %d 是奇数" % x)
原文地址: https://www.cveoy.top/t/topic/CSl 著作权归作者所有。请勿转载和采集!