Time Conversion

  • + 0 comments

    py:


    def timeConversion(s): if s.endswith('AM'): if s[:2]=='12': g = '00' return g + s[2:-2] return s[:-2] elif s.endswith('PM'): if s[:2]=='12': return (s[:-2]) g = str(int(s[:2])+12) s = g + s[2:-2] return s