This document demonstrates various string handling functions in Python including getting the length of a string, concatenating strings, converting strings to uppercase and lowercase, and capitalizing the first letter of a string. It prints the output of applying each of these functions to the string "Hello" or the concatenated string "Hello World".
This document demonstrates various string handling functions in Python including getting the length of a string, concatenating strings, converting strings to uppercase and lowercase, and capitalizing the first letter of a string. It prints the output of applying each of these functions to the string "Hello" or the concatenated string "Hello World".
This document demonstrates various string handling functions in Python including getting the length of a string, concatenating strings, converting strings to uppercase and lowercase, and capitalizing the first letter of a string. It prints the output of applying each of these functions to the string "Hello" or the concatenated string "Hello World".
print("========================") string1="Hello" print("Given string",(string1)) print("=======================") print("1.length of the string",(len(string1))) print("=======================") print("2.String concatenation") String2="World" print ("\tHello World") print ("3.covert to upper case") print("======================") print("\tWORLD") print ("4.covert to lower case") print("========================") print("\tworld") print("5.capitalize first letter") print("==========================") print("\tHello")
OUTPUT:
String Handling function
======================== Given string Hello ======================= 1.length of the string 5 ======================= 2.String concatenation Hello World 3.covert to upper case ====================== WORLD 4.covert to lower case ======================== world 5.capitalize first letter ========================== Hello >>>