A string is a collection of chars, we can store multiple characters set into String. The base Index of the String will be started from 0 to size-1 similar to LIST.but all elements of the String are connected with each other. we can write String is single quote (' '),double quote (" ") and triple quote ("""). a= 'hello' ; //Single Quote String a = "hello" //Double quote String a= """hello""" //Triple quote String s = "hello" s[0]= h s[1]= e s[2]=l s[3]=l s[4]=o Example of String Program? Q1) WAP to count the total vowel and consonant in String? Solution:- s = "hello" c1=0 c2=0 for i in range(0,len(s)): if s[i]=='a' or s[i]=='e' or s[i]=='i' or s[i]=='o' or s[i]=='u': c1=c1+1 else: c2=c2+1 print("total vowel is ",c1," total consonent is ",c2) Q2) WAP to check that String is palindrome...
Hi, I'm Shiva Gautam. With over 15 years of diverse experience in various IT domains, I am now an entrepreneur focusing on both training and software development. My expertise spans across multiple technologies, and I've authored numerous articles on subjects including Java, Python, REACT, NODE, ANGULAR, Cloud, software testing, Django framework, C#, Flutter, Salesforce, Ruby on Rails, .NET, and more. For additional information, please visit shivaconceptsolution.com and kangaroosoftware.net.