Category Archives: Python String Programs

Python Counting Words Occurrences

Topic: Counting Words Occurrences in String Python Program   # Python Program to input a string # and find number of occurrences of # each word in the given string # using a user defined function # define a user defined function # that will receive a string as an argument # will return a… Read More »

Python Recursive Function Check Palindrom String

Python Recursive Function Check Palindrom String # Write a Python program to # input a string and find # whether the string is a palindrome or not # www.easycodebook.com # Start of the Python program # define the recursive function def is_palindrome(s): if len(s) <= 1: # Base case return True elif s[0] != s[len(s)… Read More »

Python Program to convert string to Opposite case

Task: Write a Python Program to convert string to Opposite case. This Python programming tutorial will input a string and convert its letters to opposite case. It means that if this Python code will find a lower case letter, it will convert it into upper case and vice versa. For example, it will convert the… Read More »

Python Program to Convert String to Upper Case

Task: Write a Python Program to  Convert a given String to Upper Case. The Source Code of Python Program to Convert String to Upper Case # Write a Python program to # input a string and change into # upper case # The user will enter String # during program execution # author: www.EasyCodeBook.com #… Read More »

Palindrome Program in Python

Task: Write a Python program to input a string and check it for Palindrome or not. The source code of Palindrome Program in Python # Write a Python program to input # a string and check it for Palindrome # Author: www.EasyCodeBook.com s1=input(“Enter string to check for Palindrome:”) # get reversed string by string slicing… Read More »