Python: How to replace first number before a space in each line in a text file : My file look like the following:

    12.32 1:34 2:49 5:21 29:98
    13.53 1:23 2:82 5:23 29:45
    51.92 1:23 2:54 5:54 29:63
    12.42 1:34 2:43 5:32 29:32

I am trying to replace every first number in each line by another number. What would be a good method?

I tried pointing to the number  by

    with open('file.txt', 'r') as file:
    line = file.readline()
    line[0]

but it just gives me first character, not the entire number.
Thank you so much!
                