谁能告诉我这段代码有什么问题:
def greater(a,b):
if a > b:
return a
return b
num1, num2 = int(input("enter two number : ").split(","))
print(f"bigger is : {greater(num1,num2)}")
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
你有
input("enter two number : ")
that values let's say1,2
input("...").split(",")
is now['1', '2']
so alist
of 2 stringint(['1', '2'])
<< you can't do thatYou need to
map
each value toint
还是做