0
import re
NameAge = '''
Janice is 22 and Theon is 33
Gabriel is 44 and Joey is 21
'''
names = re.findall (r'[A-Z][a-z]*', NameAge)
age = re.findall(r'\d{2}', NameAge)
ageDict = {}
x = 0
for eachname in names:
ageDict[eachname] = age[0]
x+=1
print(ageDict)
輸出: { '加布裏埃爾': '22', '賈尼絲': '22', '喬伊': '22', '席恩': '22' }錯誤的輸出產生無法獲得正確的輸出