I have written the following solution for a challenge but I am not sure about its time complexity:
def ASCIIConversion(string):
newStr = ''
for chr in string:
if chr.isspace():
newStr = newStr + ' '
else:
newStr += str(ord(chr))
return newStr
Is the complexity of the program, O(logn), because of the else statement?