1#This may not be exactly what you were looking for but this is
2#something that I had trouble with and thought I'd share with everyone
3string = "abcdefghi21 jklmnop"
4string2 = "abcdefghi3476 jrtklghnopgghhr"
5#These strings are semi-random but the goal here is in both of these
6#The start is the exact same like it was in my original problem
7#Our goal is to get the numbers
8#I approached this like so
9string_r = string.replace('abcdefghi','')
10string2_r = string2.replace('abcdefghi','')
11#Now in my problem I used a for loop wich I imagine you could easily
12#Make this into a for loop and if not there is tutorials and
13#Grepper answers for them!
14#After that they will both look like so:
15#string = "21 jklmnop"
16#string2 = "3476 jrtklghnopgghhr"
17#To finsih this I split the text and stored the [0]
18string_l = string_r.split(' ')
19string2_l = string2_r.split(' ')
20#Save the variables
21num = string_l[0]
22num2 = string2_l[0]
23#results:
24print(num)
25#num = '21'
26print(num2)
27#num2 = '3476'