"Girintili bir blok bekleniyor" hatası?
Python'un neden "Expected indentation block" hatası verdiğini anlayamıyorum?
""" This module prints all the items within a list"""
def print_lol(the_list):
""" The following for loop iterates over every item in the list and checks whether
the list item is another list or not. in case the list item is another list it recalls the function else it prints the ist item"""
for each_item in the_list:
if isinstance(each_item, list):
print_lol(each_item)
else:
print(each_item)
19
2
Oradaki fonksiyon tanımından sonra doküman dizesini girintilemeniz gerekir (satır 3, 4):
Girintili:
Ya da bunun yerine yorum yapmak için
#
kullanabilirsiniz:Ayrıca, docstrings hakkında PEP 257 adresine bakabilirsiniz.
Umarım bu yardımcı olur!
Ben de bunu yaşadım mesela:
Bu kod çalışmıyor ve amaçlanan blok hatasını alıyorum.
Ancak return self.title ifadesini yazmadan önce tab tuşuna bastığımda kod çalışıyor.
Umarım bu başkalarına da yardımcı olur.