Python:每日一题 80

题目:写一个函数 reverse_string(string)def reverse_string(string):        pass复制代码该函数接收一个参数stringstring 为一个标准的英文句子要求返回string 中每一个单词颠倒后的句子For example:>>> reverse_...
2017/11/27   六月   616

Python:每日一题 78

哈哈哈,我觉得这道题特别有意思~求平均数任务:请你编写一个函数average_string(),这个函数可以接受一个字符串,这个字符串中都是英文数字,我们要通过一系列高端操作来得到英文字符串的平均数。注意:数字的范围是0到9,如果字符串中有超过这个范围的数字或者其他字符串,就返回'n / a'例子:average_string('one three two')>...
2017/11/27   六月   551

Python:每日一题 79

题目: 给定两个字符串 s1 和 s2 如果s1 内的字符通过重新组合后能成为 s2返回True否则返回False要求:分别写出s1内的字符可以重复使用和不可以重复使用时的答案 答案:您是VIP用户,您可免回复查看本帖隐藏的内容#可重复使用def test(s1,s2):        return all([i in...
2017/11/27   六月   552

Python:每日一题 77

今日题目:编写一个函数bprime。判断一个数字是否是质数,如果是质数,则返回'(那个质数数字放在这里) is prime'复制代码,如果不是就返回一个列表,列表总的内容是这个数的所有因数。例子:bprime(10)>>>[2, 5]bprime(30)>>>[2, 3, 5, 6, 10, 15]bprime(13)>&g...
2017/11/27   六月   522

Python:每日一题 76

今天的题目比较简单,也比较综合There are five workers : James,John,Robert,Michael and William.They work one by one and on weekends they rest. Order is same as in the description(James works on mondays,John wor...
2017/11/27   六月   592

Python:每日一题 75

&名字问题& My friend wants a new band name for her band. She like bands that use the formula: 'The' + a noun with first letter capitalized.dolphin -> The DolphinHowever, when a noun ST...
2017/11/27   六月   521

Python:每日一题 74

台阶问题~ 题目:一只青蛙一次可以跳一级台阶,也可以跳两级台阶,定义一个函数,求有n级台阶时有几种跳法? 答案:您是VIP用户,您可免回复查看本帖隐藏的内容def func(n):        if n == 1:              &...
2017/11/27   六月   563

Python:每日一题 73

今日来一道计算题~ 题目要求:编写一个函数(SeriesSum),该函数返回到第n项(参数)的后续序列的和 举个栗子:SeriesSum(1) => 1 = "1"SeriesSum(2) => 1 + 1/4 = "1.25"SeriesSum(5) => 1 + 1/4 + 1/7 + 1/10 + 1/13 = "1.57"复制代码...
2017/11/27   六月   599

Python:每日一题 72

今天给大家带来一道算法题~Given an unsorted array of integers, find the smallest number in the array, the largest number in the array, and the smallest number between the two array bounds that is not in the ...
2017/11/27   六月   593

Python:每日一题 71

又拿来一道题目供大佬们消遣~ 今天对大家的要求就是在完成题目的同时,尽量做到 简洁!题目要求:现有两个文件夹 A 和 B,要求写一个程序将 A 文件夹的文件同步到 B文件夹~如果 B文件夹里有A没有的文件或目录, 在B中执行删除操作如果 B 文件夹里没有 A 拥有的文件或目录, 执行复制操作答案:等待大佬填上这个空白~
2017/11/27   六月   520