Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, ..., and place ...
分类:
其他好文 时间:
2018-05-07 13:24:52
阅读次数:
183
1、列表 list1 = ['alex','bob','lili','zhangsan'] list2 = ['1','2','3','4'] 列表索引从0开始 print(list1[0]) 结果:alex print(list1[0:2]) 结果:['alex', 'bob'] 2、列表元素改名 ...
分类:
其他好文 时间:
2018-05-03 12:46:35
阅读次数:
134
Alice and Bob is playing a game. Each of them has a number. Alice’s number is A, and Bob’s number is B. Each turn, one player can do one of the follow ...
分类:
其他好文 时间:
2018-05-01 14:01:48
阅读次数:
339
切片:用于取一个list或tuple的部分元素; L = ['Michael','Sarah','Tracy','Bob','Jack'] L[0:3] //表示从索引0开始取,直到索引3为止,但不包括索引3,即索引0,1,2;正好是三个元素; L[:3] //如果第一个索引是0,还可以省略; L[ ...
分类:
编程语言 时间:
2018-04-30 18:02:44
阅读次数:
153
list(列表): list是一种有序的集合,可以随时添加和删除其中的元素 定义一个列表: classmates = ['Michael','Bob','Tracy'] 用len()函数可以获得列表元素的个数: In [3]: len(classmates)Out[3]: 3 也可以用索引访问每一个 ...
分类:
其他好文 时间:
2018-04-29 19:19:51
阅读次数:
209
Description "题库链接" 给出一个 $n\times m$ 的棋盘,棋盘的每个格子有两个权值 $A,B$ 。 Alice 和 Bob 轮流操作在棋盘上放棋子,一个格子能放棋子的前提条件是这个格子的左侧和上侧均放了棋子。对于 Alice 放棋子的格子,能获得该格子的 $A$ 的权值;对于 ...
分类:
其他好文 时间:
2018-04-29 15:30:12
阅读次数:
185
假设我们用一组tuple表示学生名字和成绩: L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]请用sorted()对上述列表分别按名字排序: Run 再按成绩从高到低排序: Run ...
分类:
其他好文 时间:
2018-04-29 13:19:18
阅读次数:
229
Codewars 刷题第五天,数组问题。 Enough is enough! Alice and Bob were on a holiday. Both of them took many pictures of the places they've been, and now they want ...
分类:
编程语言 时间:
2018-04-29 11:54:49
阅读次数:
196
1. 位置参数:一般的参数 2. 默认参数: 参数里有默认赋值,调用时用power(5)就是平方,如果power(5, 3)就是立方了 如果有多个默认参数,调用时前面用默认参数,后面不是用默认参数,则需要在调用语句中写出“参数名 = 参数值”,比如下面这个情况 enroll('bob','M',7) ...
分类:
编程语言 时间:
2018-04-28 15:41:09
阅读次数:
188
------使用CSVDE----------DN,ObjectClass,SAMAccountName,userPrincipalName,displayName,userAccountcontrol"cn=Alice,ou=HR,dc=contoso,dc=com",user,Alice,Alice@contoso.com,hujintao,512"cn=Bob,
分类:
其他好文 时间:
2018-04-27 17:58:53
阅读次数:
147