python学习
文章平均质量分 66
咕嘟咕嘟咕嘟
这个作者很懒,什么都没留下…
展开
-
python中xrange用法分析
本文实例讲述了python中xrange用法。分享给大家供大家参考。具体如下:先来看如下示例:>>> x=xrange(0,8)>>> print xxrange(8)>>> print x[0]0>>> print x[7]7>>> print x[8]Traceback (most recent call last): File "", line 1,转载 2017-04-24 14:26:38 · 707 阅读 · 0 评论 -
python学习笔记
在Python中定义函数,可以用必选参数、默认参数、可变参数、关键字参数和命名关键字参数,这5种参数都可以组合使用。但是请注意,参数定义的顺序必须是:必选参数、默认参数、可变参数、命名关键字参数和关键字参数。比如定义一个函数,包含上述若干种参数:def f1(a, b, c=0, *args, **kw): print('a =', a, 'b =', b, 'c ='转载 2017-04-18 11:10:16 · 143 阅读 · 0 评论 -
【Leetcode】【Python】【C++】1. Two Sum实现
题目:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may原创 2017-05-18 11:21:22 · 186 阅读 · 0 评论