while running the code, I am getting an error.
import re
pattern="""
(?P<title>.*)
(-\ located\ in\ )
(?P<city>\w*)
( ,\ )
(P?<state>\w*)"""
for item in re.finditer(pattern,wiki, re.VERBOSE):
print(item.groupdict())
while running the code, I am getting an error.
import re
pattern="""
(?P<title>.*)
(-\ located\ in\ )
(?P<city>\w*)
( ,\ )
(P?<state>\w*)"""
for item in re.finditer(pattern,wiki, re.VERBOSE):
print(item.groupdict())