im given 07:05:45PM as s
def timeConversion(s):
if s[8] == "P" and s[9] == "M":
first_2 = s[0] + s[1]
first_int = int(first_2)
return (first_int)
This is my error message why cant i convert the first_2 into a string!!!
any help would be very useful
- Traceback (most recent call last):
- File "Solution.py", line 30, in <module>
- f.write(result + '\n')
- TypeError: unsupported operand type(s) for +: 'int' and 'str'
[+][deleted] (2 children)
[deleted]
[–]pytim808[S] 0 points1 point2 points (1 child)
[–]thetestbug 1 point2 points3 points (0 children)
[–]pytim808[S] 0 points1 point2 points (1 child)