当前位置:网站首页>[punch in] flip the string (simple)
[punch in] flip the string (simple)
2022-07-02 03:27:00 【dataloading】
describe
Write a method , Accepts the given string as input , Returns a new string after flipping this string character by character .
Examples 1:
Input :"hello"
Output :"olleh"
Examples 2:
Input :"hello world"
Output :"dlrow olleh"
class Solution:
""" @param s: a string @return: return a string """
def reverseString(self, s):
# write your code here
l = len(s)
ans = ''
for i in range(l-1,-1,-1):
ans += s[i]
return ans
边栏推荐
- Verilog state machine
- 焱融看 | 混合云时代下,如何制定多云策略
- js生成随机数
- Global and Chinese market of X-ray detectors 2022-2028: Research Report on technology, participants, trends, market size and share
- JS generate random numbers
- IPhone 6 plus is listed in Apple's "retro products" list
- Common means of modeling: aggregation
- Kotlin 基础学习13
- PY3 link MySQL
- How to establish its own NFT market platform in 2022
猜你喜欢
Sentry experience and architecture, a fledgling monitoring product with a market value of $100million
Verilog 状态机
表单自定义校验规则
Failed to upgrade schema, error: “file does not exist
"Analysis of 43 cases of MATLAB neural network": Chapter 41 implementation of customized neural network -- personalized modeling and Simulation of neural network
[C Advanced] brother Peng takes you to play with strings and memory functions
跟着CTF-wiki学pwn——ret2shellcode
Pointer array & array pointer
初出茅庐市值1亿美金的监控产品Sentry体验与架构
Named block Verilog
随机推荐
Review materials of project management PMP high frequency examination sites (8-1)
< job search> process and signal
QT environment generates dump to solve abnormal crash
Comment élaborer une stratégie nuageuse à l'ère des nuages mixtes
跟着CTF-wiki学pwn——ret2shellcode
/silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult
MySQL advanced (Advanced) SQL statement (II)
Qt的网络连接方式
Verilog 过程赋值 区别 详解
微信小程序中 在xwml 中使用外部引入的 js进行判断计算
Learn PWN from CTF wiki - ret2shellcode
What is hybrid web containers for SAP ui5
Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
In depth interpretation of pytest official documents (26) customized pytest assertion error information
Redis set command line operation (intersection, union and difference, random reading, etc.)
C # joint Halcon's experience of breaking away from Halcon environment and various error reporting solutions
[C Advanced] brother Peng takes you to play with strings and memory functions
Qualcomm platform WiFi -- Native crash caused by WiFi
在QML中加载不同字体
Verilog 避免 Latch