【Kata Daily 190918】Spacify(插空)
题目:
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(插空)的更多相关文章
- 【Kata Daily 190929】Password Hashes(密码哈希)
题目: When you sign up for an account somewhere, some websites do not actually store your password in ...
- 【Kata Daily 190903】String incrementer(字符串增量器)
原题: Your job is to write a function which increments a string, to create a new string. If the string ...
- 【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 ...
- 【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 ...
- 【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 ...
- 【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 ...
随机推荐
- sqli-labs第三关 详解
通过第二关,来到第三关 我们用了前两种方法,都报错,然后自己也不太会别的注入,然后莫名的小知识又增加了.这居然是一个带括号的字符型注入, 这里我们需要闭合前面的括号. $sql=select * fr ...
- 【题解】SAC E#1 - 一道难题 Tree
Problem is here \(\text{Solution:}\) 首先,一眼看出这是最小割,只要叶子节点对汇点\(T\)连接流量为\(inf\)的边就可以一遍最大流搞定了. 剩下的问题在于,如 ...
- apline无法向gitlab上传git lfs问题
1 背景 在k8s中基于alpine做底层系统的容器进行git lfs push操作时,发现报错无法上传成功 Fatal error: Server error: http://git.ops.xxx ...
- 二进制安装MySQL-5.7.28
系统基础优化 #更改主机名 hostname msyql echo "msyql" >/etc/hostname #修改字符集 echo "LANG="z ...
- 多路复用select和epoll的区别(转)
先说下本文框架,先是问题引出,然后概括两个机制的区别和联系,最后介绍每个接口的用法 一.问题引出 联系区别 问题的引出,当需要读两个以上的I/O的时候,如果使用阻塞式的I/O,那么可能长时间的阻塞在一 ...
- day18 Pyhton学习 匿名函数
匿名函数 别称: lambda表达式 函数,没有名字 def wahaha(n):#wahaha return n**2 print(wahaha.__name__) qqxing = lambda ...
- ABAP 7.55 新特性 (一)
最近几天,SAP S4 2020对应的ABAP 7.55的新版文档已经出现.本文翻译了ABAP SQL之外的更新部分.ABAP SQL的更新比较长,会再之后单独成篇. 译者水平有限,如有错误,请评论指 ...
- 【C语言程序设计】小游戏之俄罗斯方块(一)!适合初学者上手、练手!
俄罗斯方块的核心玩法非常简单,所以制作起来并不是很复杂,我准备先用2篇文字的篇幅详细讲解一下俄罗斯方块的制作方法. 今天咱们算是第一篇,主要讲解俄罗斯方块中如何定义方块,以及如何实现方块的移动.旋转. ...
- Linux系统快速搭建LAMP
LAMP是 Linux + Apache + MySQL + PHP 的环境要求,即web服务器. 1.前置条件: (1)搭建Linux系统(参考博客:https://www.cnblogs.com/ ...
- rpm|yum安装的查看安装路径
[root@localhost src]# rpm -qa|grep grafanagrafana-7.1.0-1.x86_64[root@localhost src]# rpm -ql grafan ...