Skip to content

Commit bff1cf7

Browse files
committed
replace check with pythonic code attempt
1 parent 93e2a71 commit bff1cf7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Python/chapter01/1.3 - URLify/miguel_1.3_sol.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def urlify(s: str, true_length: int) -> str:
2525
# Below link goes over string concat efficiency in python (I will use method 4
2626
# https://waymoot.org/home/python_string/
2727
output = []
28-
for i, c in enumerate(s):
29-
if i == true_length:
30-
break
28+
for c in s[0:true_length]:
3129
if c == ' ':
3230
output.append("%20")
3331
continue

0 commit comments

Comments
 (0)