if使用方法举例:
import random #随机生成1-100的整数 n = random.randint(1, 100) if n > 50: print(n, "> 50") elif n == 50: print(n, "=50") else: print(n, "< 50")
时间: 2024-10-20 03:26:31
if使用方法举例:
import random #随机生成1-100的整数 n = random.randint(1, 100) if n > 50: print(n, "> 50") elif n == 50: print(n, "=50") else: print(n, "< 50")