标签: prolog
我想获得数字import re input = 'I have 4 apple' my_dict = { "fruit": ["apple", "banana", "pear"] } m = re.match(r'I have 4 (%s)' % '|'.join(my_dict['fruit']), input) print(True if m else False, m.group(1)) 坐标的用户输入,我该怎么做?
import re input = 'I have 4 apple' my_dict = { "fruit": ["apple", "banana", "pear"] } m = re.match(r'I have 4 (%s)' % '|'.join(my_dict['fruit']), input) print(True if m else False, m.group(1))
例如,我在想:
(X,Y)
不要以为这会成功。