Write a function multisplit that consumes two positive integers total and split and produces the number of times total is repeatedly divided into split even pieces before each piece is of size at most 1. For example, the value returned by multisplit(8, 2) will be 3, since 8 can be split into 2 pieces of size 4, which are then each split into 2 pieces of size 2, which are then each split into 2 pieces of size 1 (at which point no further splitting takes place since the pieces are of size at most 1).計數循環
total= int(input("Total:"))
split= int(input("Split:"))
def multisplit(total,split):
x=o
while value>=1:
value= total//split
x= x+1
return x
print(x)
一個功能它告訴我,名稱爲「x」沒有被定義
它給出的* exact *消息是什麼?它是'NameError:名稱'x'未定義'?如果不是,請說明。它會發生什麼? – SethMMorton
是的,這是顯示的錯誤,它出現在第11行(最後一個) –