python报错

Traceback (most recent call last):

# 追溯(最近一次调用)

  File "C:/Users/yanshanshan/PycharmProjects/untitled1/124.py", line 17, in <module>

    list6 = random.choice['嘉航','逸白','子墨','子初']

TypeError: 'method' object is not subscriptable:

#“方法”对象不可订阅

TypeError: sample() missing 1 required positional argument: 'k'

# TypeErrorSample()缺少一个必需的位置参数:‘K

TypeError: 'str' object does not support item assignment

# 类型Errorstr对象不支持项赋值..

TypeError: 'tuple' object does not support item assignment

# TypeError:‘tuple’对象不支持项分配

原文地址:https://www.cnblogs.com/yssshiny/p/11720624.html