#Function that takes an integer and return a integer-looking string with thousands seperator def thousands(integer): #Convert int to str strInt = str(integer) counter=0 #variable that will hold the string we will construct newStrInt = "" #loop over string from end to start for i in range(len(strInt)-1, -1, -1): #if we found a third digit, then place comma before it if counter != 0 and counter % 3 == 0: newStrInt=","+newStrInt #concat the strings newStrInt = strInt[i] + newStrInt counter+=1 return newStrInt tax = 0.33 salary = 99834 name="Khobaib" msg = f'''Customer {name}, makes {thousands(salary)} a year. \tHe pays {round(tax*salary, 2)} in taxes every year.''' print(msg)