I'm working on file contains a few lines of numerical sequences. I want to multiply some part of this string. How am I supposed to do it? When I just do 'num[10:](which is for ex 2)*4' (like below) it prints me '2' four times, I want to print 8.
import os
from datetime import date
with open('C:\\Users\\X\\Desktop\\python\\Y\\Z.txt') as file:
numbers = file.readlines()
def last_number():
for num in numbers:
last = num[10:]
x = last*4
print(x)
last_number()