Skip to content

Commit ccf314d

Browse files
authored
Update README.md
Updated the prints of the second set of code examples Signed-off-by: Hubert Daniszewski <[email protected]>
1 parent 6310c10 commit ccf314d

File tree

1 file changed

+2
-4
lines changed
  • docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252

1 file changed

+2
-4
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ This non-compliant code example shows that using this value will point to the la
7676
def find_in_string(full_string, sub_string):
7777
"""Function that searches for a sub-string in a given string"""
7878
index = full_string.find(sub_string)
79-
print(f"""Sub-string '{sub_string}' appears for the first time in
80-
'{full_string}' at index {index}: '{full_string[index:]}'""")
79+
print(f"Sub-string '{sub_string}' appears in '{full_string}' at index {index}'")
8180

8281

8382
#####################
@@ -107,8 +106,7 @@ def find_in_string(full_string, sub_string):
107106
"""Function that searches for a sub-string in a given string"""
108107
index = full_string.find(sub_string)
109108
if index >= 0:
110-
print(f"""Sub-string '{sub_string}' appears for the first time in
111-
'{full_string}' at index {index}: '{full_string[index:]}'""")
109+
print(f"Sub-string '{sub_string}' appears in '{full_string}' at index {index}'")
112110
else:
113111
print(f"There is no '{sub_string}' in '{full_string}'")
114112

0 commit comments

Comments
 (0)