def f1(nums):
l1=[]
l2=[]
for i in nums:
if int(i)%2==0:
l1.append(i)
else:
l2.append(i)
l2.extend(l1)
return ''.join(l2)
nums=eval(input())
print(f1(nums))
无法打印出
def f1(nums):
l1=[]
l2=[]
for i in nums:
if int(i)%2==0:
l1.append(i)
else:
l2.append(i)
l2.extend(l1)
return ''.join(l2)
nums=eval(input())
print(f1(nums))
无法打印出
我给你改了一下:
def f1(nums):
l1=[]
l2=[]
for i in nums:
if int(i)%2==0:
l1.append(i)
else:
l2.append(i)
return l2+l1
nums=eval(input())
print(f1(nums))