以下代码怎么改成while循环?
def maxnum(lst):
maxn = 0
for i in lst:
if maxn < i:
maxn = i
return maxn
def minnum(lst):
minn = lst[0]
for i in lst:
if minn > i:
minn= i
return minn
a = [3,4,6,7]
print(maxnum(a) - minnum(a))