I am trying to find a way to get input from the user which is a list of numbers and words. Then I want to print out only the numbers from that list. I can't figure out how to separate them, and then only print out the numbers. I think that the answer might be through exporting the items in the list that are numbers to a dictionary and then printing said dictionary, but I don't know how to do that. Here is the code that I have already:
string1=input("Please input a set of positive numbers and words separated by a space: ")
string2=string1.split(" ")
string3=[string2]
dicts={}
for i in string3:
if isinstance(i, int):
dicts[i]=string3[i]
print(dicts)