SHARE
TWEET

Untitled

a guest Apr 26th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
  2.  
  3.  
  4. ```python3
  5. # -*- coding:utf-8 -*-
  6. class Solution:
  7.     # s 源字符串
  8.     def replaceSpace(self, s):
  9.         # write code here
  10.         return "%20".join(list(s.split(" ")))
  11. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top