python - python中的错误“IndexError:元组索引超出范围”是什么意思?
问题描述
我试图清理我的代码,而不是对函数使用一堆 if 语句。这是我的代码:
def tic(inpinp, board, qweqwe):
global lik
ink = inpinp - 1
lik = board.insert(ink, qweqwe)
lis = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
p = input("Player 1, would you like to be X or O?")
inpu = int(input("Where would you like to go?"))
print('{}|{}|{}'.format())
print('--|--|--'.format())
print('{}|{}|{}'.format())
print("--|--|--".format())
print('{}|{}|{}'.format())
解决方案
推荐阅读
- c - c语言链表实现队列
- java - 获取当前温度 CPU android
- java - JPA ManToMany 关联并使用 Spring Data Repository 插入、检索数据
- javascript - 无法重新填充表单
- unit-testing - 有没有办法在 kdb+ 中进行宏单元测试?
- java - 当错误来自 Mono 的 zip 方法时对 doOnError 方法的单元测试
- php - PHP 回调:类的方法是否有 ::class 的等价物?
- ruby-on-rails - 构建失败(Ubuntu 20.04 使用 ruby-build 20210119)
- r - 如何在绘图点上绘制一条平滑线,例如绘图的轮廓/天际线?
- python - Django 过滤器:使用分页器在用户和配置文件模型中搜索