[python] Lift is short, I need python!
来源:互联网 发布:淘宝沙滩裙桑蚕丝 编辑:程序博客网 时间:2024/04/28 12:33
Example 1: Reverse words in a String
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue
",
return "blue is sky the
".
class Solution: # @param s, a string # @return a string def reverseWords(self, s): if len(s)==0 : return s #reverse the whole string first s=s[::-1] sret="" wordlist=s.split(' ') for word in wordlist: if sret!="" and word!="": sret+=" " word=word[::-1] if word!="": sret+=word return sret
0 0
- [python] Lift is short, I need python!
- life is short, you need python
- Life is short, you need Python
- SE复习日记【三】Life is short, you need Python
- Life is too short, Use python?
- Life is short, you need Pytho
- YOU NEED PYTHON writeup
- JarvisOJ-You-Need-Python-wp
- python-I
- Anomaly Detection, a short tutorial using Python
- Python中变量自增、i+=x与i=i+x、is与==
- python中的is ,is not
- I learn Python
- Enterprise Python I Met
- Python File I/O
- Python 文件I/O
- Python 点滴 I
- python 模拟登录i
- 最长上升子序列之基础
- 大整数相乘
- Cocos2d-x 多点触摸
- 今日食谱
- iBeacon的一些资料
- [python] Lift is short, I need python!
- 静态代理示例
- JAVA排序算法<概述>
- Asakura的魔法世界
- 浮躁
- 小Y的难题
- 群聊天
- 自定义ViewGroup
- 编程之美之格格取数