Skip to content

Commit fddaeeb

Browse files
Add documentation examples for consider-using-join. (#6637)
Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 5fa3386 commit fddaeeb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def fruits_to_string(fruits):
2+
formatted_fruit = ""
3+
for fruit in fruits:
4+
formatted_fruit += fruit # [consider-using-join]
5+
return formatted_fruit
6+
7+
print(fruits_to_string(["apple", "pear", "peach"]))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("".join(["apple", "pear", "peach"]))

0 commit comments

Comments
 (0)