Skip to content

Commit 12c74a2

Browse files
truncate.md reconformed to PEP 8
removed Tab
1 parent 1ee65c6 commit 12c74a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snippets/python/string-manipulation/truncate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: string,truncate
88

99
```py
1010
def truncate(s:str, length:int, suffix:bool = True) -> str :
11-
return (s[:length] + ("" if suffix else "")) if len(s) > length else s
11+
return (s[:length] + ("" if suffix else "")) if len(s) > length else s
1212

1313
# Usage:
1414
truncate('This is a long string', 10) # Returns: 'This is a …'

0 commit comments

Comments
 (0)