def timeConversion(s): if \'PM\' in s: if s[1] == \'1\' or \'2\' or \'3\' or \'4\' or \'5\' or \'6\' or \'7\' or \'8\' or \'9\': oneDigitMilTime = int(s[1]) + 12 return str(oneD