首页 > 解决方案 > 为什么如果我想添加另一个显示消息错误“预期缩进错误”的函数

问题描述

如果我添加一些功能为什么期望缩进块我的间距或标签我的代码有什么问题

def coverage ():


#fungsi througput
def througput ():
    print("---------------menghitung througput Tower-------------------")

    print ("====Plih band====")
    print("[]. 1.5 MHz, 6 RB")
    print("[]. 3 MHz, 15 RB")
    print("[]. 5 MHz, 25 RB")
    print("[]. 10 MHz, 50 RB")
    print("[]. 15 MHz, 75 RB")
    print("[]. 20 MHz, 100 RB")
    band =  input ("masukan pilihan (RB bandwith) : ")

标签: python

解决方案


试试这个:

def coverage ():
    pass

#fungsi througput
def througput ():

    print("---------------menghitung througput Tower-------------------")

    print ("====Plih band====")
    print("[]. 1.5 MHz, 6 RB")
    print("[]. 3 MHz, 15 RB")
    print("[]. 5 MHz, 25 RB")
    print("[]. 10 MHz, 50 RB")
    print("[]. 15 MHz, 75 RB")
    print("[]. 20 MHz, 100 RB")
    band =  input ("masukan pilihan (RB bandwith) : ")

在 python 缩进很重要。在深入 Python 世界之前,您应该花一些时间阅读它。尝试做一些像这样的基本教程


推荐阅读