Below is a simple python 2.7 code using class and objects.
class Student:
def __init__(self,name,pref):
self.name = name
self.preference = pref
student1=Student("Tom","cce")
print(student1.name)
print(student1.preference)
How can this code be implemented so that the name and preference values(string) are taken using user-input(raw_input())
Here's an example:
Here is also a working code.