【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 ...
随机推荐
- 搭建go-stress-testing压力测试
参考地址:https://github.com/link1st/go-stress-testing安装golang环境 yum install -y golang 下载软件包 wget -q http ...
- 《我想进大厂》之Redis夺命连环11问
这是面试题系列第三篇--redis专题. 说说Redis基本数据类型有哪些吧 字符串:redis没有直接使用C语言传统的字符串表示,而是自己实现的叫做简单动态字符串SDS的抽象类型.C语言的字符串不记 ...
- MySql 关闭 bin 和 log 日志
mysql 的 bin 和 .log 日志文件会非常占用磁盘空间和 IO,修改 mysql 配置文件可以关闭这两种日志的记录. 关闭 bin 日志,将下面三项配置注释掉: #log_bin = mys ...
- docker-命令帮助
1. 命令参考 http://www.runoob.com/docker/docker-command-manual.html2. docker-命令,可以使用docker --help查看或 ...
- MySQL中Redo Log相关的重要参数总结
参数介绍 下面介绍.总结一下MySQL的Redo Log相关的几个重要参数:innodb_log_buffer_size.innodb_log_file_size.innodb_log_files ...
- docker overlay原理
周末两天研究了一下docker overlay网络的原理,因为我本身对go语言不太熟悉,直接看docker官方的libnetwork库看不太懂,看linux内核的vxlan代码又粗心大意,导致有一个环 ...
- 多测师讲解常用的测试工具分为10类_高级讲师肖sir
我们将常用的测试工具分为10类. 1. 测试管理工具 2. 接口测试工具 3. 性能测试工具 4. C/S自动化工具 5.白盒测试工具 6.代码扫描工具 7.持续集成工具 8.网络测试工具 9.app ...
- Rust之路(3)——数据类型 下篇
[未经书面同意,严禁转载] -- 2020-10-14 -- 架构是道,数据是术.道可道,非常道:术不名,不成术!道无常形,术却可循规. 学习与分析数据类型,最基本的方法就是搞清楚其存储原理,变量和对 ...
- 【python】python返回结果多了none(递归时)
把每个返回值的print使用return替代即可 例子: def trim(s): if s[:1]==" ": s=s[1:] retrim(s) elif s[-1:]==&q ...
- Jenkins+pytest+Allure搭建自动化测试
持续集成(CONTINUOUS INTEGRATION) 在CI环境中,开发人员将会频繁地向主干提交代码.这些新提交的代码在最终合并到主干前,需要经过编译和自动化测试流进行验证. 持续交付(CONTI ...