2017年10月19日

python基本语法2.7--综合训练之实现字符串的翻转

摘要: 问题描述: 字符串按单词反转(必须保留所有空格)。' I love china! '转化为'' china! love I ' 1.http://blog.csdn.net/caroline_wendy/article/details/23438739 参考上述博客了解到实现python字符串的五种 阅读全文

posted @ 2017-10-19 21:27 小嘤嘤 阅读(314) 评论(0) 推荐(0)

python基本语法2.6--类型

摘要: # -*- coding: utf-8 -*- import string # 基本类型 print(type(None)) print(type(True)) print(type(12345)) print(type(123.45)) print(type(1234.)) print(type('abc')) # 容器类型 print(type([1, 2, 3, 'a', 'bc']... 阅读全文

posted @ 2017-10-19 16:30 小嘤嘤 阅读(375) 评论(0) 推荐(0)

python基本语法2.5--字符串的相关操作

摘要: # -*- coding: utf-8 -*- import string # strip去除空格 s = ' abcd efg ' print(s.strip()) print(s.lstrip()) print(s.rstrip()) print(s) # 字符串连接 print('abc_' 阅读全文

posted @ 2017-10-19 16:27 小嘤嘤 阅读(274) 评论(0) 推荐(0)

python基本语法2.4---汉诺塔的递归

摘要: 算法:当只有一个盘子的时候,只需要从将A塔上的一个盘子移到C塔上。 当A塔上有两个盘子是,先将A塔上的1号盘子(编号从上到下)移动到B塔上,再将A塔上的2号盘子移动的C塔上,最后将B塔上的小盘子移动到C塔上。 当A塔上有3个盘子时,先将A塔上编号1至2的盘子(共2个)移动到B塔上(需借助C塔),然后 阅读全文

posted @ 2017-10-19 15:16 小嘤嘤 阅读(259) 评论(0) 推荐(0)

python基本语法2.3--函数及参数传递

摘要: # -*- coding: utf-8 -*- # 函数定义和默认参数 def func(x, y = 500): print(x, y) func(150) func(100, 200) func(y = 300, x = 100) # 可变参数 def func(name, *numbers): print(name) print(numbers) func(... 阅读全文

posted @ 2017-10-19 14:57 小嘤嘤 阅读(318) 评论(0) 推荐(0)

python基本语法2.2--函数名当作变量传递

摘要: def do_sum(data,method): return method(data) print(do_sum([1,2,3,4],sum)) 阅读全文

posted @ 2017-10-19 14:56 小嘤嘤 阅读(434) 评论(0) 推荐(0)

python基本语法2.1--if判断和while,for循环

摘要: # -*- coding: utf-8 -*- # if判断 a = 100 b = 200 c = 300 if c == a: print(a) elif c == b: print(b) else: print(c) # None的判断 x = None if x is None: print('x is None') if not x: pri... 阅读全文

posted @ 2017-10-19 14:55 小嘤嘤 阅读(269) 评论(0) 推荐(0)

AlexNet源码

摘要: http://www.cnblogs.com/vipyoumay/p/7686230.html 阅读全文

posted @ 2017-10-19 14:54 小嘤嘤 阅读(1555) 评论(0) 推荐(0)

导航