Alle Dateien aus dem Pythonkurs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
563 B

from vornamen_reader import read_vornamen
import re
def print_vornamen_simple(vornamen):
for vorname in vornamen:
print(vorname)
def print_vornamen_filtered(vornamen,regex):
pattern = re.compile(regex)
for vorname in vornamen:
# print(f"{type(r)}: {r}")
# s = re.findall(regex,vorname)
# if s[0] != '':
is_match = pattern.match(vorname).span()[1] >0
if is_match:
print(f'{is_match}: {vorname}')
vornamen = read_vornamen('./Vornamen_Wuppertal_2020.csv')
#print_vornamen_simple(vornamen)
print_vornamen_filtered(vornamen,'O*')