May-11-2020, 06:44 PM
Hi,
I am trying to format a list of phonenumbers.
I want to move through the list and do the same operation on each number, I have figured out how to do it one number at a time.
Would an option be to add a for loop?
I am trying to format a list of phonenumbers.
I want to move through the list and do the same operation on each number, I have figured out how to do it one number at a time.
Would an option be to add a for loop?
import re # List with phonenumbers number = ['072 5674 323', "072 540 6789", "0047735 648975"] # Remove spaces num = re.sub(r'\D', "", number[0]) # Read backwards num_1 = num[-9:] #Print country code + formated number print(F"0047{num_1}") #Output 0047735674323