Skip to Main Content
Blog

Check Case of a String in Python

Check Case of a String in Python

def main():
	"""
	Checks if a string is in lower case, upper case or mixed case.
	"""

	txt = input("Enter string: ")

	if txt.islower():
		print("Lower Case")
	elif txt.isupper():
		print("Upper Case")
	else:
		print("Mixed Case")


if __name__ == "__main__":
	main()