python
拙异
这个作者很懒,什么都没留下…
展开
-
Python bug and error
1.TypeError: 'type' object is not subscriptable 如果你想对python内部已经定义好的tpye对象(比如:string dict tuple)进行操作,那么会返回上面 TypeError 比如 对tuple进行索引操作: >>> tuple[1] Traceback (most recent call last): Fi...原创 2018-09-10 21:15:14 · 224 阅读 · 0 评论 -
1.将N道题随机排列,组成N套试卷,输出n份txt文件
以下面的题为例子: 班上有35个学生,要对他们进行关于28个中国省会城市的小测验,现在打算打乱问题次序,让每一份试卷独一无二。 #create 30 quizs with questions and answers in random,along with the answers keyself. import random #the quiz data . keys ...原创 2018-09-19 11:10:35 · 224 阅读 · 0 评论