Easily done with zip:
l = [[1,'raj','CSE'],[2,'kumar','MECH'],[3,'Nisha','ECE']]
d = dict(zip(['Id', 'Name', 'Course'], map(list, (zip(*l)))))
d
# {'Course': ['CSE', 'MECH', 'ECE'],
# 'Id': [1, 2, 3],
# 'Name': ['raj', 'kumar', 'Nisha']}
Since you want to convert it to a dict first before saving it to a csv, I'm assuming you use pandas (otherwise it'd have been easier to save it in its existing form). This is easily done:
df = pd.DataFrame(d) # `d` is from the code snippet above.
df
Course Id Name
0 CSE 1 raj
1 MECH 2 kumar
2 ECE 3 Nisha
df.to_csv('test.csv')
Alternatively, if you don't want to use pandas, just do this:
l = [[1,'raj','CSE'],[2,'kumar','MECH'],[3,'Nisha','ECE']]
with open('test.csv', 'w') as f:
writer = csv.writer(f)
writer.writerow(['Id', 'Name', 'Course'])
writer.writerows(l)
In this situation, you do not require conversion to a dictionary.