期望一个缩进的块 [英] Expected an indented block

查看:114
本文介绍了期望一个缩进的块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误预期缩进块



当我试图以python cript运行程序时



这是我的代码: -





def simple():#创建功能名为simple

打印(asdadasd)





thx提前



我尝试了什么:



???????????????????? ?????????????????????????????????????????????????? ??????????????????????????????????????????????????????????????????????????????????????????????????????????????

 def simple():#创建名为simple的函数
print(asdadasd)



注意: 请注意 print 语句前面的四个空格字符。



Python Functions [ ^ ]


i am getting the error " expected an indented block"

when ever i tried to run the program as python cript

here's my code:-


def simple():#creating function named simple
print("asdadasd")


thx in advance

What I have tried:

????????????????????????????????????????????????????????????????????????????????

解决方案

Most likely because Python expects you to indent your code correctly, and you haven't:

def simple():#creating function named simple
    print("asdadasd")


NB: Note the four space characters in front of the print statement.

Python Functions[^]


这篇关于期望一个缩进的块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆