- 博客(5)
- 收藏
- 关注
转载 python列表及其排序操作
1 print ('\n------------3.3.1-永久性排序--------\n') 2 cars = ['bmw','audi','toyoto','subaru'] 3 # 列表操作的.sort()方法排序,默认为a-z顺序排列,如果按照z-a排列需要传递一个参数'reverse=True' 4 cars.sort() ...
2019-02-01 16:27:00 113
转载 python的列表及其操作
1 bicycles = ['trek','cannondale','redline','specialized'] 2 print (bicycles) 3 bicycles.append('ducati') 4 # append方法,在结尾添加元素 5 print (bicycles) 6 bicycles.insert(3,'suzuki') 7 # ...
2019-02-01 15:15:00 96
转载 Code Combat学习心得(边之森林-森林劈斩者)
# 尽可能经常使用你的新技能“cleave” hero.moveXY(23, 23) while True: #查找敌人,然后给赋值给变量enemy enemy = hero.findNearestEnemy() # 如果hero.isReady为真,就使用“Cleave”干掉敌人! if hero.isReady("cleave"): ...
2018-03-09 12:26:00 231
转载 Code Combat学习心得(边之森林-九个宝石)
# Collect all the gems in 4 moveXY's or less!# Programmers need to think creatively!# 本章的目标在于只能用4步完成游戏,用常规思维围着宝石走,至少要6句# 所以在这里,用4句代码走一个大的三角形就能完成 1 hero.moveXY(32,48) 2 hero.moveXY(70,48) ...
2018-03-05 11:31:00 268
转载 Code Combat学习心得(Kithgard地牢45关Mightier Than the Sword)
代码来自(Kithgard地牢45关Mightier Than the Sword) # A variable is a way of holding on to a value. #变量是一种保存值的方式。 # Here the "password" variable holds the secret phrase we need.#这里“password”变量保存我们需要...
2018-03-04 11:56:00 247
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人