#Python[超话]#请教下各位大佬python这种list要怎么写函数才能在不考虑字符串的情况下返回数字最大值呢(就只比较其中int和float的大小)
我是想用array.pop()
for i in range(0, len(array)-1):
if (type(i) == str):
array.pop(i)
return array[-1]
但是这样写运行完发现并不能remove掉字符串
请教大佬们要怎么写才可以呢
我是想用array.pop()
for i in range(0, len(array)-1):
if (type(i) == str):
array.pop(i)
return array[-1]
但是这样写运行完发现并不能remove掉字符串
请教大佬们要怎么写才可以呢
#Python[超话]#
想请教下这样的list列表要怎么写函数才能在不比较字符串大小的情况下返回数字的最大值呢(包括int和float)
想用array.pop()
但是关于循环怎么写试了好多次都不太对
for i in range(0,len(array)-1):
if(type(i) == str):
array.pop(i)
return array[-1]
这样写似乎并不能remove掉字符串
不知道要怎么修改一下
求大佬指教
想请教下这样的list列表要怎么写函数才能在不比较字符串大小的情况下返回数字的最大值呢(包括int和float)
想用array.pop()
但是关于循环怎么写试了好多次都不太对
for i in range(0,len(array)-1):
if(type(i) == str):
array.pop(i)
return array[-1]
这样写似乎并不能remove掉字符串
不知道要怎么修改一下
求大佬指教
#新书#
Eight long years of war exposed the unrealistic nature of elite demands for unreserved commitment. As the political leaders faced numerous obstacles in material mobilization and retreated to rhetoric of spiritual resistance, the Chinese populace resorted to localized strategies ranging from stoic adaptation to cynical profiteering, articulated variously with touches of humor and tragedy.
Eight long years of war exposed the unrealistic nature of elite demands for unreserved commitment. As the political leaders faced numerous obstacles in material mobilization and retreated to rhetoric of spiritual resistance, the Chinese populace resorted to localized strategies ranging from stoic adaptation to cynical profiteering, articulated variously with touches of humor and tragedy.
✋热门推荐