11问答网
所有问题
当前搜索:
Python菜鸟
python
自学
菜鸟
expected an indented block什么意思
答:
Python
是对缩进敏感的语言,最常见的情况是tab和空格的混用会导致错误,或者缩进错误,而这是用肉眼无法分别的。在编译时出现错误IndentationError:expected an indented block,说明此处需要缩进,你只要在出现错误的那一行,按空格或Tab(但不能混用)键缩进就行。
python
自学
菜鸟
expected an indented block什么意思
答:
该缩进的地方没有缩进,就会报错expected an indented block 因为
Python
语言是一款对缩进非常敏感的语言 比如下面的代码 1 2 3 4 a = 1 b=0 if a>b:print "a>b"会报错 File "D:/num.py", line 4 print "a>b"^ IndentationError: expected an indented block 修改如下 a = 1 b=2 if ...
python
自学
菜鸟
expected an indented block什么意思
答:
该缩进的地方没有缩进,就会报错expected an indented block 因为
Python
语言是一款对缩进非常敏感的语言 比如下面的代码 a = 1b=0if a>b:print "a>b"会报错 File "D:/num.py", line 4 print "a>b"^ IndentationError: expected an indented block 修改如下 a = 1b=2if a>b: print "...
Python
学生学习网站
答:
3.
Python
中文官方教程 来自
python
官方的教程, 让你学的放 心,用的安心。4.w3 school 很多大佬推荐的一个学习网站里面也有 详细的python讲解, 和实战, 测试也 是你不错的选择哦!!,最关键的是所 有资源免费使用。5.
菜鸟
教程 网站非常适合新手入门!从基础的语法 开始,每篇文章都配有实例,而且...
python
自学
菜鸟
expected an indented block什么意思
答:
简单来说,代码没有正确地缩进,也就是首行的空格不正确
Python
使用缩进来表示代码之间的从属关系 比如一个for循环,print函数之前的4个空格就是缩进 for i in range(10): print(i)
菜鸟
问一下,怎么用
python
编程 1/0!+1/1!+1/2!+...+1/10000!
答:
代码示例 """
菜鸟
问一下,怎么用
python
编程 1/0!+1/1!+1/2!+...+1/10000!"""import mathresult = 0for i in range(0, 10001): result += 1/math.factorial(i)print(result)输出 2.7182818284590455输出截图
菜鸟
关于
python
问题请教。 为什么以下代码不能执行函数中比较大小的功...
答:
应该是max(int(a), int(b))你a和b是字符串,不转怎么比?如果不是在整数,就把int换成float
python菜鸟
问题?
答:
client.connect(("localhost",6969))提示告诉你,connect方法不能接收元组对象作为参数,("localhost",6969)这样是一个元组 修改为 client.connect("localhost",6969)
菜鸟
的
python
在线编译器能否打开本地文件,如果能怎么打开?
答:
应当是不行的,在线编辑器应当是运行在一个虚拟的环境中,所以不能读取出本机文件的。看这样得到的文件路径是/box,感觉像是一个容器。
python
自学
菜鸟
expected an indented block什么意思
答:
意思是期待缩进块,因为
python
是以缩进来决定代码块的,所以忘记缩进或者错误缩进会导致代码不能运行或者运行结果出错,请检查你的代码缩进!
<涓婁竴椤
1
2
3
4
5
6
7
8
涓嬩竴椤
其他人还搜
selenium切换div
python初学者
Python教程
java下一页