这个数组有序吗
运行下面这段程序:
a = [13, 15, 17, 23, 24]
ok = True
for i in range(1, len(a)):
if a[i] < a[i - 1]:
ok = False
print(ok)
运行下面这段程序:
a = [13, 15, 17, 23, 24]
ok = True
for i in range(1, len(a)):
if a[i] < a[i - 1]:
ok = False
print(ok)
全部评论