Python program to check if a word is a noun Last Updated : 11 Dec, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Given a word, the task is to write a Python program to find if the word is a noun or not using Python. Examples: Input: India Output: India is noun. Input: Writing Output: Writing is not a noun. There are various libraries that can be used to solve this problem. Approach 1: PoS tagging using NLTK Python3 # import required modules import nltk nltk.download('averaged_perceptron_tagger') # taking input text as India text = "India" ans = nltk.pos_tag([text]) # ans returns a list of tuple val = ans[0][1] # checking if it is a noun or not if(val == 'NN' or val == 'NNS' or val == 'NNPS' or val == 'NNP'): print(text, " is a noun.") else: print(text, " is not a noun.") Output: India is a noun. Approach 2: PoS tagging using Spacy Python3 # import required modules import spacy nlp = spacy.load("en_core_web_sm") # taking input text = "Writing" # returns a document of object doc = nlp(text) # checking if it is a noun or not if(doc[0].tag_ == 'NNP'): print(text, " is a noun.") else: print(text, " is not a noun.") Output: Writing is not a noun. Comment More infoAdvertise with us Next Article Python program to check if a word is a noun D d2anubis Follow Improve Article Tags : Technical Scripter Python Python Programs Technical Scripter 2020 Python string-programs +1 More Practice Tags : python Similar Reads Python program to check if a given string is Keyword or not This article will explore how to check if a given string is a reserved keyword in Python. Using the keyword We can easily determine whether a string conflicts with Python's built-in syntax rules.Using iskeyword()The keyword module in Python provides a function iskeyword() to check if a string is a k 2 min read Python program to check if given string is pangram The task is to check if a string is a pangram which means it includes every letter of the English alphabet at least once. In this article, weâll look at different ways to check if the string contains all 26 letters.Using Bitmasking Bitmasking uses a number where each bit represents a letter in the a 2 min read Python program to count words in a sentence In this article, we will explore different methods for counting words in a sentence. The split() method is one of the simplest and most efficient ways to count words in a sentence.Pythons = "Python is fun and versatile." # Counting words word_count = len(s.split()) print(word_count) Output5 Explanat 2 min read Python Program to find if a character is vowel or Consonant Given a character, check if it is vowel or consonant. Vowels are 'a', 'e', 'i', 'o' and 'u'. All other characters ('b', 'c', 'd', 'f' ....) are consonants. Examples: Input : x = 'c'Output : ConsonantInput : x = 'u'Output : VowelRecommended: Please try your approach on {IDE} first, before moving on t 5 min read Check if String is Empty or Not - Python We are given a string and our task is to check whether it is empty or not. For example, if the input is "", it should return True (indicating it's empty), and if the input is "hello", it should return False. Let's explore different methods of doing it with example:Using Comparison Operator(==)The si 2 min read Like