with open('profiles/profiles.txt', encoding='utf-8') as f:
data = f.readlines()
from collections import namedtuple
User = namedtuple('User', 'id, group, name')
data = {}
with open('profiles/profiles.txt', encoding='utf-8') as f:
for line in f:
user_id, group, name = line.strip().split(':')
data[int(row_id)] = User(int(user_id), group, name)
user = data[2]
print('{} состоит в группе {}'.format(user.name, user.group))