Is this a verbose way to do a conversion between 12 hour time and 24 hour time? And if so what's more of clean way of doing it

前端 未结 0 623
北海茫月
北海茫月 2021-02-03 11:38

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

相关标签:
回答
  • 消灭零回复
提交回复
热议问题