I think that generally speaking, it is very easy for girls to take the initiative to talk to boys.
Just as "a man chases a girl, there is a mountain between them; a woman chases a man, there is a veil between them", a boy's pursuit of a girl is as difficult as climbing over mountains and ridges.
And a girl's pursuit of a boy is just like a thin veil that is vaguely visible and within reach.
As long as there is a will, most wishes can be easily fulfilled.
As for the situation described in the question, since they are both students and in the elective group, this boy is also the group leader;
It is most convenient and best to answer him. The best way is to regularly look for opportunities to ask him questions about electives.
Then, he naturally asked for his contact information for the purpose of asking for advice.