Python编译时提示错误 IndentationError: unexpected indent
来源:互联网 发布:国家针对大数据的规划 编辑:程序博客网 时间:2024/06/15 02:59
问题描述:
我是昨天才开始学的Python,今天尝试练习下写了个小Demo,运行的时候报错了,提示第二行有个错误IndentationError: unexpected indent。
a=int(input('请输入a值:')) print('您输入的a=',a)b=int(input('请输入b值:')) print('您输入的b=',b)print('a+b=',a+b);
分析: indentation是缩进的意思。unexpected indent 就是说第二行这里存在一个“意外的”缩进。也就是说,这里的问题就是指“print”是一个意外的缩进。可以看到第二行是缩进了一个字符位。查了下百度,看了下别人说好像取消缩进顶格写,就可以了。
a=int(input('请输入a值:'))print('您输入的a=',a)b=int(input('请输入b值:'))print('您输入的b=',b)print('a+b=',a+b);
结论: 在python中,每一句代码都应该顶格写。
0 0
- Python编译时提示错误 IndentationError: unexpected indent
- python3.4 编译时提示错误 IndentationError: unexpected indent
- python3.4 编译时提示错误 IndentationError: unexpected indent
- python错误:IndentationError: unexpected indent
- Python错误IndentationError: unexpected indent
- Python编程错误之IndentationError: unexpected indent
- python常见错误:IndentationError: unexpected indent
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- python:IndentationError: unexpected indent
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- Python的IndentationError: unexpected indent
- python报"IndentationError: unexpected indent"
- Python常见的缩进错误IndentationError: unexpected indent
- python的IndentationError: unexpected indent python
- Inno setup制作安装包时向注册表中写安装后的路径
- smarty 与 js 赋值 数组
- C#读取路径的几种方法
- codevs 2627 村村通
- git中报unable to auto-detect email address 错误的解决办法
- Python编译时提示错误 IndentationError: unexpected indent
- Spring 框架中切入点 pointcut 表达式的常用写法
- 各种排序算法的时间复杂度
- 负载均衡1.5--案例(下)
- 详解PHP文件下载的原理和实现
- Andrew Ng的机器学习课程概述(二)
- atom无法安装插件解决方法
- 单例模式的七种写法
- Q&A——UI输入(三)