题目:

Modify the spacify function so that it returns the given string with spaces insertedbetween each character.

spacify("hello world") # returns "h e l l o   w o r l d"

解题办法:

def spacify(string):
#your code here
return ' '.join(list(string))

用时:5分59秒

知识点:

1、str转化为list:list(str)

2、list转化为str:''.join(list)

【Kata Daily 190918】Spacify(插空)的更多相关文章

  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 190903】String incrementer(字符串增量器)

    原题: Your job is to write a function which increments a string, to create a new string. If the string ...

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

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

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

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

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

  6. 【Kata Daily 190924】Difference of Volumes of Cuboids(长方体的体积差)

    题目: In this simple exercise, you will create a program that will take two lists of integers, a and b ...

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

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

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

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

随机推荐

  1. 浅谈 Java集合

    Java 集合 集合是对象的容器,定义了多个对象进行操作的常用方法,可实现数组的功能. Java集合类库所处位置:java.util.*. 与现代的数据结构类库的常见做法一样,Java集合类库也将接口 ...

  2. 解决mybatis-plus更新数据的时候,有值为空导致更新失败的问题

    问题 在用mybatis-plus更新数据的时候,更新失败,错误信息如下: Cause: org.apache.ibatis.type.TypeException: Could not set par ...

  3. Fullscreen API与DOM监听API

    前言 以下几个API,在web开发中可以简化我们一部分交互操作. Fullscreen API 有时候我们想要全屏预览的效果,比如类似于图片预览.幻灯片播放等.全屏API是一个很好的选择. 基本用法 ...

  4. 对NETIF_F_GSO的一些理解

    看linux内核协议栈的时候看到tcp_sendmsg函数,看起来并不难理解,但是申请skb的时候主buff大小让我很困惑.我以前一直以为会根据sack/ip option/pmtu等计算一个mss, ...

  5. 通过MapReduce降低服务响应时间

    在微服务中开发中,api网关扮演对外提供restful api的角色,而api的数据往往会依赖其他服务,复杂的api更是会依赖多个甚至数十个服务.虽然单个被依赖服务的耗时一般都比较低,但如果多个服务串 ...

  6. Cypress系列(65)- 测试运行失败自动重试

    如果想从头学起Cypress,可以看下面的系列文章哦 https://www.cnblogs.com/poloyy/category/1768839.html 重试的介绍 学习前的三问 什么是重试测试 ...

  7. day30 Pyhton 复习模块

    一.模块 什么是模块. 模块就是我们把装有特定功能的代码进行归类的结果. 从代码编写的单位来看我们的程序, 从小到大的顺序: 一条代码 < 语句句块 < 代码块(函数, 类) < 模 ...

  8. 学习使用C语言/C++编程的7个步骤!超赞~

    C是一种编译性语言.如果你以前从来没有接触过任何的编程语言,那么你则需要学习一下一个拆分的逻辑思维.当我们想要写一个项目或者软件的时候,我们需要把这个整体拆分为7个步骤,这样也会让你的思路看起来更有条 ...

  9. 第十二章 配置vlan

    一.vlan技术简介 1.广播风暴 广播风暴(broadcast storm)简单的讲是指当广播数据充斥网络无法处理,并占用大量网络带宽,导致正常业务不能运行,甚至彻底瘫痪,这就发生了"广播 ...

  10. django—路由相关

    django不同版本的路由配置 django 2之前,配置urlpatterns使用的是url方法 django 2之后,配置urlpatterns使用的是path方法 path与url的区别: ur ...