【发布时间】:2020-05-12 15:45:04
【问题描述】:
想检查一个数字是否在给定范围内。
def ran_check(num,low,high):
if num in range(low,high):
print('{num} is not in the range of {low} and {high}')
else:
print('{num} is not in the range of {low} and {high}')
【问题讨论】:
-
您的问题不清楚。你的退货单在哪里?
-
你要返回什么样的“数值”? 1 还是 0?如果是这样,为什么? Python 有布尔值
标签: python-3.x string methods boolean