你好,這裏是我的Python代碼:IndentationError:取消縮進不匹配任何外部縮進級別蟒蛇
def is_palindrome(nombre):
if str(nombre) == str(nombre)[::-1]:
return True
return False
x = 0
for i in range(100, 1000):
for j in range(i, 1000):
for z in range(j, 1000):
produit = i*j*z
if is_palindrome(produit):
if produit > x:
x = produit
print(x)
當我試圖編譯這段代碼中,我得到了錯誤: produit =我Ĵž ^ IndentationError:unindent不匹配任何外部縮進級別 任何人有一個想法,請??
我有問題的思路:取消縮進沒有按不匹配任何外部縮進級別。縮進在Python中很重要,所以你必須修復它。檢查您每個級別使用多少個空間,檢查是否有任何標籤,等等。 – TigerhawkT3
事實上:程序正在工作,但是當我在範圍(j,1000)中添加z時:我乘以i和j乘以z我得到了錯誤 – nour
我不明白爲什麼 – nour