def strNcompare(s1,s2,n):
	val=0
	if s1[0:n].lower()>s2.lower():
		val=1
	if s1[0:n].lower()<s2.lower():
		val=-1
	return val	
def Userinput():
	x1 = str(input('string comparision[1(play), -1(quit)]:'))
	if x1 == str(1):
		s1 = str(input('First string entered by user: '))
		s2 = str(input('Second string entered by user: '))
		n = int(input('enter number of Character to Compare: '))
		result=strNcomapre(s1,s2,n)
		if result==1:
			print(s1+" It is greater than "+s2)
		elif result==-1:
			print(s1+" It is not greater than "+s2)
		else:
			print(s1+" It is equal to "+s2)
		Userinput()
	else:
		print("Finished")
Userinput()
