【Kata Daily 191012】Find numbers which are divisible by given number
题目:
Complete the function which takes two arguments and returns all numbers which are divisible by the given divisor. First argument is an array of numbers and the second is the divisor.
Example
divisible_by([1, 2, 3, 4, 5, 6], 2) == [2, 4, 6]
解题方法:
def divisible_by(numbers, divisor):
return [x for x in numbers if x%divisor == 0]
【Kata Daily 191012】Find numbers which are divisible by given number的更多相关文章
- 【Kata Daily 190929】Password Hashes(密码哈希)
题目: When you sign up for an account somewhere, some websites do not actually store your password in ...
- 【Kata Daily 190923】Odder Than the Rest(找出奇数)
题目: Create a method that takes an array/list as an input, and outputs the index at which the sole od ...
- 【Kata Daily 190920】Square(n) Sum(平方加总)
题目: Complete the square sum function so that it squares each number passed into it and then sums the ...
- 【Kata Daily 190919】Sort Out The Men From Boys(排序)
题目: Scenario Now that the competition gets tough it will Sort out the men from the boys . Men are th ...
- 【Kata Daily 190911】Multiplication Tables(乘法表)
题目: Create a function that accepts dimensions, of Rows x Columns, as parameters in order to create a ...
- 【kata Daily 190905】What's a Perfect Power anyway?(完美幂)
原题: A perfect power is a classification of positive integers: In mathematics, a perfect power is a p ...
- 【Kata Daily 190904】Calculating with Functions(函数计算)
原题: This time we want to write calculations using functions and get the results. Let's have a look a ...
- 【Kata Daily 191010】Grasshopper - Summation(加总)
题目: Summation Write a program that finds the summation of every number from 1 to num. The number wil ...
- 【Kata Daily 190927】Counting sheep...(数绵羊)
题目: Consider an array of sheep where some sheep may be missing from their place. We need a function ...
随机推荐
- 实验 6:OpenDaylight 实验——OpenDaylight 及 Postman 实现流表下发
一.实验目的 熟悉 Postman 的使用;熟悉如何使用 OpenDaylight 通过 Postman 下发流表. 二.实验任务 流表有软超时和硬超时的概念,分别对应流表中的 idle_timeou ...
- sql注入里关键字绕过的发现
网上大量文章,甚至<黑客攻防技术实战宝典-WEB实战篇>里面都说一些关键字如 select 等绕过可以用注释符/**/. 例如: select,union.可以用 ,se/**/lect, ...
- 字节码暴力破解censum(老版本)
声明 事先声明,本文仅提供破解方法以供个人及读者们学习Java字节码,不提倡破解程序. 本文是个人学习掘金小册张师傅的<JVM字节码从入门到精通>后,作为一个实践的记录,并无恶意. 关于c ...
- c 判断端口是否已被使用
isPortOpen.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include & ...
- http_parser
最近读了 http_parser 的源码,记录下. 有意思的地方: 1) 协议解析可以不完全解析完,但是当前 parser 会记录解析状态,这样可以继续解析 2) 协议解析首要还是要了解协议 ...
- EV加密播放器的分析过程+过虚拟机方法
开启了OD载入播放器进行分析,发现如下问题:1.播放器会进行翻录检测2.防止虚拟机播放3.视频播放后,可直接对内存操作提取出源视频翻录检测:主要是对指定的文件名或进程名对比虚拟机检测:是针对虚拟机特征 ...
- 单源文件目录makefile
目录结构 由于只是用来编译简单的小型程序,所以目录尽量简洁: . ├── build │ ├── bin │ ├── .dep │ └── obj ├── makefile └── src ...
- xuexi
1.内存的编址方法就是内存地址与内存单元格一一对应且永久绑定.计算机的cpu只认识内存地址,不关心内存单元格的位置和内容.通过硬件的设计来达到通过内存地址找到内存单元格. 2.内存的编址是以字节为单位 ...
- beego和gin对比
一.对mvc的支持 beego支持完整的mvc M:Model,beego orm,把数据库数据变成object 特性 支持go的所有类型存储 更简洁的curd风格 完整实现了健壮的ORM 支持的数据 ...
- jsp 记录1 bs/cs
1.jsp = html + js + css + jsp语法 + Java片段: 2.jsp是基于Java语言的,具有跨平台性: 3.jsp编译后的class文件会常驻内存中,运行速度快,对服务器的 ...