def get_sample(name, gender):
	""" Get the features of an input sample.

	The method takes a training sample as input and computes the following 4 features from every name:
		- Ends with A
		- Frequency of A
		- Ends with E 
		- Second from last character is N

	Args
		name: name of a person
		gender: The label corresponding to the gender. Possible values are Male 'M' or Female 'F'.

	Returns
		tuple:
			features : list of numeric feature values. (4 x 1)
			classification : '0' for Male and '1' for Female.

	"""
	features = []
	name = name.strip()
	
	##Ends with A
	if name[-1] == 'A':
		features.append(1)
	else:
		features.append(0)

	##Ends with 'E'
	if name[-1] == 'E':
		features.append(1)
	else:
		features.append(0)

	#Freq of A
	features.append( name.count('A') )

	##2nd character from end is N
	if name[-2] == 'N':
		features.append(1)
	else:
		features.append(0)

	#Gender Label 
	if gender == 'M': 
		classification = 0
	else:
		classification = 1

	return (features, classification)