File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252 Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,7 @@ This non-compliant code example shows that using this value will point to the la
7676def 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
You can’t perform that action at this time.
0 commit comments