python - 为什么如果我想添加另一个显示消息错误“预期缩进错误”的函数
问题描述
如果我添加一些功能为什么期望缩进块我的间距或标签我的代码有什么问题
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) : ")
解决方案
试试这个:
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 世界之前,您应该花一些时间阅读它。尝试做一些像这样的基本教程
推荐阅读
- sql - 删除非冲突数据的 Upsert 语句 (Postgres)
- reactjs - 使用 flex:1 导致卡片堆叠,没有 flex 显示列表但没有滚动
- javascript - 使用 JS 从 HTML 点击从 div 生成链接
- javascript - 如何发送响应请求帖子以保存在数据库中?节点?
- android - 退出 Firebase AuthUI 时单击两次错误
- javascript - 如何在 Polymer 中随机化 div 的显示顺序
- r - aes_string() 内的缩放值
- c# - C# 从另一个窗体获取文本框值
- wso2 - 无法在 WSO2 IoT 服务器中配置 JMS 队列:缺少文档
- ios - “AuthDataResult”类型的值没有成员“isEmailVerification”