We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12cfd41 commit 496ab92Copy full SHA for 496ab92
Arrays_And_Strings/URLify.py
@@ -0,0 +1,19 @@
1
+'''
2
+URLify: Write a method to replace all spaces in a string with '%20'. You may assume that the string
3
+has sufficient space at the end to hold the additional characters, and that you are given the "true"
4
+length of the string. (Note: If implementing in Java, please use a character array so that you can
5
+perform this operation in place.)
6
+EXAMPLE
7
+Input: "Mr 3ohn Smit h 13
8
+Output: "Mr%203ohn%20Smith"
9
+Hints: #53,0118
10
+
11
12
13
+def Urlify(string):
14
+ return "%20".join(tuple(string.strip().split(" ")))
15
16
+if __name__ == '__main__':
17
+ str1 = input("Enter String >> ")
18
+ answer = Urlify(str1)
19
+ print(answer)
0 commit comments