题目:

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的更多相关文章

  1. 【Kata Daily 190929】Password Hashes(密码哈希)

    题目: When you sign up for an account somewhere, some websites do not actually store your password in ...

  2. 【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 ...

  3. 【Kata Daily 190920】Square(n) Sum(平方加总)

    题目: Complete the square sum function so that it squares each number passed into it and then sums the ...

  4. 【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 ...

  5. 【Kata Daily 190911】Multiplication Tables(乘法表)

    题目: Create a function that accepts dimensions, of Rows x Columns, as parameters in order to create a ...

  6. 【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 ...

  7. 【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 ...

  8. 【Kata Daily 191010】Grasshopper - Summation(加总)

    题目: Summation Write a program that finds the summation of every number from 1 to num. The number wil ...

  9. 【Kata Daily 190927】Counting sheep...(数绵羊)

    题目: Consider an array of sheep where some sheep may be missing from their place. We need a function ...

随机推荐

  1. 056 01 Android 零基础入门 01 Java基础语法 06 Java一维数组 03 一维数组的应用

    056 01 Android 零基础入门 01 Java基础语法 06 Java一维数组 03 一维数组的应用 本文知识点:数组的实际应用 程序开发中如何应用数组? 程序代码及其运行结果: 不同数据类 ...

  2. 051 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 13 Eclipse下程序调试——debug入门1

    051 01 Android 零基础入门 01 Java基础语法 05 Java流程控制之循环结构 13 Eclipse下程序调试--debug入门1 本文知识点: 程序调试--debug入门1 程序 ...

  3. 01 How does C Programming work ? C语言如何工作?

    where is C used ? C 语言的应用场景 C is widely used C语言被广泛应用于: For creating desktop applications 用于创建桌面应用程序 ...

  4. 【题解】[NOI2011]阿狸的打字机

    阿狸的打字机 \(\text{Solution:}\) 首先观察三种操作:一种是插入一个字符,一种是退回上一步(回到父亲节点). 所以,我们可以对操作串进行模拟,并处理出每一个串在树上的位置. 接下来 ...

  5. java之网络编程1-Tcp

    一,了解之前先了解一下网络基础 首先理清一个概念:网络编程 != 网站编程,网络编程现在一般称为TCP/IP编程 一般的网络编程都称为Socket编程,Socket的英文意思是"插座&quo ...

  6. Vue3实战系列:结合 Ant-Design-of-Vue 实践 Composition API

    Vue 3 出来之后,很多人有如下想法,"又要学新东西啦"."我学不动了"等等. 但是事物总有它的两面性,前端知识更新的很快,利好勤奋好学的同学.计算机行业的迭 ...

  7. 初探电波钟(A Brief Introduction Of Radio Controlled Clock AND Its Appliciations)

    文档标识符:Radio_Controlled_Clock_T-D-P11 作者:DLHC 最后修改日期:2020.10.12 本文链接:https://www.cnblogs.com/DLHC-TEC ...

  8. Python库之SQLAlchemy

    一.SQLAlchemy简介 1.1.SQLAlchemy是什么? sqlalchemy是一个python语言实现的的针对关系型数据库的orm库.可用于连接大多数常见的数据库,比如Postges.My ...

  9. Linux nginx 安装 启动

    nginx下载地址:https://nginx.org/download/ ## 解压 tar -zxvf nginx-1.9.9.tar.gz ##进入nginx目录 cd nginx-1.9.9 ...

  10. 自定义 Spring Boot Starter

    关于Starter Spring Boot秉承"约定大于配置"的开发方式,使得我们基于Spring Boot开发项目的效率变得十分高.相信使用过Spring Boot的小伙伴都会发 ...