题目: 如果一个list是一组打乱的数字 list1=[3,2,1,9,10,78,6] 如何用python将这组打乱的数字进行冒泡排序? 题解: ...
分类:
编程语言 时间:
2017-09-12 13:49:31
阅读次数:
194
题目:如何打印出阶梯状的99乘法表? 题解: ...
分类:
编程语言 时间:
2017-09-12 13:40:25
阅读次数:
121
题目: 如何用python去求出下一个(大于28的)完全数? (求出10000以内所有的完全数) 分析: 如果一个数恰好等于它的因子之和,则称该数为"完全数".各个小于它的约数(真约数,列出某数的约数,去掉该数本身,剩下的就是它的真约数)的和等于它本身的自然数叫做完全数,又称完美书或完备数. 1.第 ...
分类:
编程语言 时间:
2017-09-12 12:08:20
阅读次数:
675
题目: 用python写一个猜数字的游戏,游戏规则如下: 1.由一个人随机写一个整数1-99(如:21) 2.一群小伙伴轮流猜数字,如第一个人猜一个数(如:48),则缩小范围至(1-48) 3.如第二个人猜一个数(如:9),则缩小范围为(9-48) 4.以此类推,直到猜中数字(21),游戏结束 分析 ...
分类:
编程语言 时间:
2017-09-12 12:05:30
阅读次数:
138
Python面试题 之前同事问了一道Python题目如下,暂时归类为面试题 题目:把类似'123.456'的字符串转换成浮点型数据 方法一: >>> print '{:.3f}'.format(float('123.456')) >>> 123.456 方法二:指定map、reduce高阶函数 思路 ...
分类:
编程语言 时间:
2017-08-07 01:31:44
阅读次数:
241
题目是:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小。 好吧,上一次的小练习,正好让我碰到了一个类似的: 所以这次就修改下使用: ...
分类:
编程语言 时间:
2017-07-05 17:15:12
阅读次数:
128
题目: Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is ...
分类:
编程语言 时间:
2017-06-18 18:13:52
阅读次数:
163
题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 没事来做 ...
分类:
编程语言 时间:
2016-12-02 03:00:40
阅读次数:
210
Python题目: 1.打印一个九九乘法表 #!/usr/bin/env python # -*- coding: utf-8 -*- """ __author__ = 'YeXiaodong' __QQ__= '12519460' __Email__ = 'ye_xiaodong@qq.com' ... ...
分类:
编程语言 时间:
2016-11-22 22:57:54
阅读次数:
238
题目链接https://leetcode.com/problems/top-k-frequent-elements/题目原文
Given a non-empty array of integers, return the k most frequent elements.
For example,
Given [1,1,1,2,2,3] and k = 2, return [1,...
分类:
编程语言 时间:
2016-07-30 21:14:30
阅读次数:
239