python - 如何修复 WingIDE for python 3 上的制表符和空格不一致?
问题描述
我遇到了这段代码的问题,它本身并不是任何实际的代码,而是导致我出现问题的间距。这个文件是这样的,当我运行它时,它说“在缩进中不一致使用制表符和空格(2,第 11 行) ”所以就在 def is_less_than 之后。我不知道这意味着什么,并且知道如何解决它,任何帮助将不胜感激。谢谢。
class Student():
def __init__(self, id, name, mark):
'''Initialize the object properties'''
self.id = id
self.name = name
self.mark = mark
def __str__(self):
'''Informal string representation of Student'''
return ' - {}, {}, {}'.format(self.id, self.name, self.mark)
def is_less_than(self, another_student):
'''
Checks if the mark of the student is less than the mark of another
Student object
Input: another_student (Student)
Returns: boolean
'''
# TODO - remove the pass and complete the function
pass
def recursive_merge_sort(data):
'''
Uses MergeSort to sort the list of data in INCREASING order
Returns: the sorted list of Students
'''
# TODO - remove the pass and complete the function
# Hint: modify your merge sort from exercise 1
pass
解决方案
推荐阅读
- python - 如何确定一个元素是否已经在某个位置的列表中?
- git - git fetch -p -f 不使用 GitHub 修剪本地分支
- php - 如何使数组遵循严格的形式?
- python - 尝试在 Python/Django 中清理非常基本的 MySQL SELECT
- chef-infra - 覆盖包装说明书中的资源定义
- algorithm - 对共轭梯度方法的改进?
- sql - sql多对多关系,如何找到双打
- python - 在python中使用相同的分隔符分割字符串
- android - getDefaultSharedPreferences 上传递的上下文会影响结果吗?
- python - 在 sudo python3 中导入时包不可用