2018年7月21日

python走迷宫

摘要: #coding=utf-8arr = []lu = []def zou(m,y,x,_y,_x): #到达新点,将当前所在点设置为墙 m[y][x] = 0 #将当前所在点添加进路线 lu.append([x,y]) if y==_y and x==_x:#判断是否到了目的地 arr.append( 阅读全文

posted @ 2018-07-21 10:37 听风的夜 阅读(764) 评论(0) 推荐(0) 编辑

2018年2月24日

(自兴人工智能) python 元组

摘要: # -*- coding: utf-8 -*-# 建立一个元组a = (1,2,3,4,5)#元组用小括号包裹,并且括号里的元素用逗号分隔就代表这是一个元组,元组与列表不同的是元组里面的元素不能修改。#元组的基本操作有访问,修改,删除,索引和截取等#访问元组:可以使用下标索引访问元组中的值b = ( 阅读全文

posted @ 2018-02-24 16:11 听风的夜 阅读(118) 评论(0) 推荐(0) 编辑

2018年2月13日

(自兴人工智能) 玩转 python 字符串

摘要: # -*- coding: utf-8 -*-#字符串的声明可以单引号,双引号,三引号str1 = 'hello'print str1#结果:hellostr2 = "my"print str2#结果:mystr3 = '''python'''print str3#结果:python#python三 阅读全文

posted @ 2018-02-13 14:18 听风的夜 阅读(141) 评论(0) 推荐(0) 编辑

2018年2月7日

(自兴人工智能)Python 列表(List)的灵活使用

摘要: # -*- coding: UTF-8 -*-list1 = ['a', 123, 23.4, 'you', 456]list2 = [123, 'jojo']#输出原列表print list1print list2# 在列表末尾添加新的元素list1.append(6)# append()方法是增 阅读全文

posted @ 2018-02-07 15:36 听风的夜 阅读(341) 评论(0) 推荐(0) 编辑

导航