you can use:
df['dummy'] = df.y.apply(lambda x: 1 if x == 'Accepted' else 0)
if you want to use a for loop:
new_dummy_data = []
for value in df.y.values:
if value == 'Accepted':
new_dummy_data.append(1)
else:
new_dummy_data.append(0)
df['dummy'] = new_dummy_data