12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 19/08/2019
Strings and String Manipulations
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
The default value of stride is
0
-1
1
-0
2.
Which function returns the number of substrings occurs within the given range?
return ()
count ()
substring ()
range ()
3.
A substring can be taken from the original string by using
{}
()
[]
<>
4.
_____ is a substring of a mainstring.
stride
slice
concat
append
5.
Which of the following is used to access and manipulate the strings
Index value
Subscript
Argument
Parameters
a or b
6.
String index values are also called as
class
function
subscript
arguments
7.
8.
Which of the following formatting character is used to print exponential notation in upper case?
%e
%E
%g
%n
9.
Strings in python:
Changeable
Mutable
Immutable
flexible
10.
Defining strings within triple quotes allows creating:
Single line Strings
Multiline Strings
Double line Strings
Multiple Strings
11.
What is the use of title () function? Give example.
12.
Differentiate lower () and is lower ().
13.
What is meant by stride?
14.
How will you manipulate the strings?
15.
What is String?
16.
Write a note on
(i) isalnum ()
(ii) isalpha ()
(iii) isdigit ()
17.
Write the output for the following statement.
(i) print ("PYTHON" . lower ())
(ii) print ("PYTHON" . islower ())
(iii) print ("PYTHON" . isupper ())
(iv) print ("PYTHON" . upper ())
18.
Write the syntax and example of using string characters.
19.
Write a note about count( ) function in python.
20.
Write a Python program to display the given pattern
C O M P U T E R
C O M P U T E
C O M P U T
C O M P U
C O M P
C O M
C O
C
21.
Write a python program to display the number of vowels and consonants in the given string.
22.
Explain about string operators in python with suitable example.
23.
%E
24.
%X
25.
%G
26.
%0
27.
%i
1.
(c)
1
2.
(b)
count ()
3.
(c)
[]
4.
(b)
slice
5.
(e)
a or b
6.
(c)
subscript
7.
(d)
8.
(b)
%E
9.
(c)
Immutable
10.
(b)
Multiline Strings
11.
| title() | Returns a string in title case | >>>str1='education department' >>>print(str1.title()) Education Department |
12.
| lower() | Returns the exact copy of the string with all the letters in lowercase. |
>>> str1='SAVE EARTH' >>> print(str1.lower()) save eath |
| islower() | Returns True if the string is in lowercase. | >>> str1='welcome' >>> print (str1.islower()) True |
13.
When the slicing operation, you can specify a third argument as the stride, which refers to the number of characters to move forward after the first character is retrieved from the string. The default value of stride is 1.
14.
(i) Once you define a string, python allocate an index value for its each character.
(ii) These index values are otherwise called as subscript which are used to access and manipulate the strings. The subscript can be positive or negative integer numbers.
15.
(i) String is a data type in python, which is used to handle array of characters.
(ii) String is a sequence of Unicode characters that may be a combination of letters, numbers, or special symbols enclosed within single, double or even triple quotes.
(iii) Example :
Welcome to learning Python"
"Welcome to learning Python"
""Welcome to learning Python""
16.
| Syntax | Description | Example | |
| (i) | isalnum () | Returns True if the string contains only letters and digit. It returns False. If the string contains any special character like _,@,#,*,etc. |
>>>str1='Save Earth' >>>str1.isalnum() False The function returns False as space is an alphanumeric character. >>>'save 1 Earth'. isalnum() True |
| (ii) | isalpha () | Returns True if the string contains only letters Otherwise return False. |
>>>'Click123'. isalpha() False >>>'python'.isalpha() True |
| (iii) | isdigit () | Returns True if the string contains only numbers. Otherwise it returns False |
>>>str1='Save Earth' >>>print(str1.isdigit()) |
17.
(i) python
(ii) false
(iii) false
(iv) PYTHON
18.
Syntax:
("String to be display with %vall and %vaI2" %(val1, vaI2))
Example:
name = "Rajarajan''
mark = 98
print ("Name: %s and Marks: %d" %(name,mark) )
Output:
Name: Rajarajan and Marks: 98
19.
| Syntax | Description | Example |
| count (str,beg,end) | Returns the number of substrings Occurs within the given range. Remember that substring may be a single character. Range (beg and end) arguments are optional. If it is not given, python searched in whole string. Search is case sensitive. | >>>str1="Raja Raja Chozhan" >>>print(str1.count("Raja")) 2 >>>print(str1.count("r")) 0 >>>print(str1.count("R")) 2 >>>print(str1.count("a")) 5 >>>print(str1.count('a',0,5)) 2 >>>print(str1.count('a',11)) 1 |
20.
Str 1 = "COMPUTER"
index = 0
for i in str 1:
print (str 1[:index -1])
index =1
21.
str1=input ("Enter a string:")
str2="aAeEiloOuU"
v,c=0,0
for i in str1:
if i in str2:
v+=1
else:
c+=1
print ("The given string contains {} vowels and {} consonants".format(v.c))
Output:
Enter a string: Tamilnadu School Education.
The given string contains 11 vowels and 15 consonants.
22.
String Operators:
Python provides the following operators for string operations. These operators are useful to manipulate string.
(i) Concatenation (+):
Joining of two or more strings is called as Concatenation. The plus (+) operator is used to concatenate strings in python.
Example:
>>> "welcome" + "Python"
'welcome python'
(ii) Append (+ =):
Adding more strings at the end of an existing string is known as append. The operator += is used to append a new string with an existing string.
Example:
>>> str1 = "welcome to"
>>> str1 + = "Learn Python"
>>> print (str1)
Welcome to Learn Python
(iii) Repeating (*):
The multiplication operator (*) is used to display a string in multiple number of times.
Example:
>>> str1= "welcome "
>>> print (str1 *4)
Welcome Welcome Welcome Welcome
(iv) String slicing:
Slice is a substring of a main string.
A substring can be taken from the original string by using [ ] operator and index or subscript values. Thus [ ] is also known as slicing operator. Using slice operator, we have to slice one or more substrings from a main string.
General format of slice operation:
str[start:end]
Where start is the beginning index and end is the last index value of a character in the string. Python takes the end value less than one from the actual index specified.
Example: I
Slice a single character from a string
>>>str 1 = "THIRUKKURAL"
>>>print (str 1 [0])
T
(v) Stride when slicing string:
Example :
>>>str1 = "Welcome to learn python"
>>>print(str1[::-2])
Output :
nhy re teolW
23.
exponential notation
24.
hexadecimal integer
25.
short number in exponential form
26.
octal integer
27.
signed decimal integer
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards