Class 11 Computer Science String Manipulation Check Point 10.2 Sumita Arora Solution
Check Point 10.2 (String Manipulation)
Que 1. What is the role of these functions? (i) isalpha( ) (ii) isalnum( ) (iii) isdigit( ) (iv) isspace( )
Ans: (i) islapha( ): Returns True if characters of the given string are alphabets. (ii) isalnum( ): Returns True if characters of the given string are either alphabets or numeric. If whitespace or special symbols are part of the given string or the string is empty it returns False. (iii) isdigit( ):Returns True if characters of the given string are digits symbol. (iv) isspace( ): Returns True if the string is non-empty and all characters are white spaces (blank, tab, newline, carriage return).
Que 2. Name the case-related string manipulation functions.
Ans: Case-related string manipulation functions are
lower()
upper()
title()
capitalize( )
Que 3. Hos is islower( ) function different from lower( ) function ?
Ans: islower() function is used to check the given string is in lowercase or not. While lower() function is used to convert the given string into the lower case alphabet.
Que 4. What is the utility of find( ) function?
Ans: find() function is used to search and check the existence of any substring in the string. It returns the index position of the first occurrence of substring in to the given string.
Que 5. How is capitalize( ) function different from upper( ) function ?
Ans: capitalize( ) function converts the string into the Sentence case i.e. the first character of the string in upper case and all characters of the string in lower case. upper( ) functioin converts all the characters of string in UPPER case.