We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
consider-using-join
1 parent 5fa3386 commit fddaeebCopy full SHA for fddaeeb
doc/data/messages/c/consider-using-join/bad.py
@@ -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"]))
doc/data/messages/c/consider-using-join/good.py
@@ -0,0 +1 @@
+print("".join(["apple", "pear", "peach"]))
0 commit comments