新人,怎么给数字定一个范围
python吧
全部回复
仅看楼主
level 2
wit💯
楼主
就像那种小于等于x大于等于y或者x到y那种
2023年01月26日 05点01分
1
吧务
level 12
一周休七日
没这东西
也许你要的是随机数
2023年01月27日 00点01分
2
level 14
雨巷纸伞-迷途
range??range(y,x+1)
2023年01月27日 03点01分
3
level 4
爱姆姆😜
示例:
pythonCopy code
x = 5
if x in range(10, 20):
print("x is in the range of 10 to 20")
else:
print("x is not in the range of 10 to 20")
2023年01月28日 01点01分
4
1