I have a variable which has time in H:M:S format like below
h2='00:00:01'
i want to change the H part in it to 10 so that it becomes
h2='10:00:01'
I tried the below code, but it dint work
h2.split(':')[0]=10
print(h2)
Output:
00:00:01
Expected Output:
10:00:01
How can i change the value of part of a variable?
datetimemodule if you are going to be working with dates extensivelydatetimeis built-in, but there are others like for examplearrowas well.