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: 03/02/2021
12th Standard Computer Science English Medium Strings and String Manipulations Reduced Syllabus Important Questions With Answer Key 2021
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.
What is the output for the following?
'mammals'. find ('ma')
0
1
-1
3
2.
The function used to search the first occurrence of the substring In the given string is
search ()
find ()
find string ()
searchstring ()
3.
Which of the following function used to capitalize the first character of the string?
captial ()
firstcapital ()
capitalize ()
capitalizefirst ()
4.
Which of the following is used as a place holders which get replaced along with format function?
[]
()
{}
<>
5.
What is Escape sequence character for the description character with octal value?
\OHH
\OOO
/OOO
/OHH
6.
What is the output from the following statement?
str1 = "welcome"
print (str1[:: 3]
come
orne
wce
wel
7.
The _____ operator is used to display a string in multiple number of time.
*
* *
* =
+ +
8.
In python _____ are immutable.
Characters
Strings
Numbers
Functions
9.
_____ is a combination of letters, numbers or special symbols enclosed with. If, " "or '" '"
String
Function
Parameters
Scope fo aviable
10.
String index values are also called as
class
function
subscript
arguments
11.
Which of the following allows creation of multiline strings
' '
" "
'''''' ''''''
none of these
None of these
12.
13.
What is stride?
index value of slide operation
first argument of slice operation
second argument of slice operation
third argument of slice operation
14.
Strings in python:
Changeable
Mutable
Immutable
flexible
15.
What will be the output of the following code?
str1 = "Chennai Schools"
str1[7] = "-"
Chennai-Schools
Chenna-School
Type error
Chennai
16.
What is the use of title () function? Give example.
17.
Write the output for the following statement.
(i) print ("save earth".title ())
(ii) print ("Save Earth".swapcase ())
18.
Write a note on the function center ().
19.
if strl = "Welcome to learn python", then write the output for the following.
(i) print (strl [10 : 16])
(ii) print (strl [10 : 16: 4])
(iii) print (strl [10: 16: 2])
(iv) print (strl [: : 3])
20.
Write a program to print the following output
C
CO
COM
COM
COMP
COMPU
COM PUT
COMPUTE
COMPUTER
21.
Write the output for the following if strl = "THIRIKKURAL"
(i) print (strl [0])
(ii) print (strl [0:5])
(ill) print (strl [:5])
(iv) Print (strl [6:])
22.
How will you manipulate the strings?
23.
24.
How will you delete a string in Python?
25.
What is String?
26.
With an example program explain about membership operators?
27.
Write a note on
(i) isalnum ()
(ii) isalpha ()
(iii) isdigit ()
28.
Write the output for the following statement.
(i) print ("PYTHON" . lower ())
(ii) print ("PYTHON" . islower ())
(iii) print ("PYTHON" . isupper ())
(iv) print ("PYTHON" . upper ())
29.
Write the output of the following statements.
(i) 'Python 2.3' . isalpha ()
(ii) 'Python Program' . is alnum ()
(iii) 'Python' . isupper ()
30.
Write the output of the following statements.
strl = 'mammals'
(i) std. find ('ma')
(ii) std. find ('ma', 2)
(iii) std. find ('ma', 2, 4)
(iv) std. find ('ma', 2, 5)
31.
Write the output of the following statements.
(i) print (len ("Corporation"))
(ii) print ("school", Capitalize ())
(iii) print ("Welcome" center (15, '*'))
32.
Write the description for the following escape sequence.
(i) \r
(ii) \000
(iii) \v
33.
Write the usage of the following format string characters.
(i) % c
(ii) % d (or) % i
(iii) % s
34.
Write the syntax and example of using string characters.
35.
Write a program to accept a string and print it in reverse order.
36.
How the positive and negative subscript values are assigned? Give example.
37.
Write a note about count( ) function in python.
38.
What is the use of format( )? Give an example.
39.
Write a short about the followings with suitable example:
(a) capitalize( )
(b) swapcase( )
40.
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
41.
Write a python program to display the number of vowels and consonants in the given string.
42.
Write a python program to print the following pattern
*
**
***
****
*****
43.
Write a python program to check whether the given string is palindrome or not.
44.
Explain about string operators in python with suitable example.
1.
(a)
0
2.
(b)
find ()
3.
(c)
capitalize ()
4.
(c)
{}
5.
(b)
\OOO
6.
(c)
wce
7.
(a)
*
8.
(b)
Strings
9.
(a)
String
10.
(c)
subscript
11.
(c)
'''''' ''''''
12.
(d)
13.
(d)
third argument of slice operation
14.
(c)
Immutable
15.
(c)
Type error
16.
| title() | Returns a string in title case | >>>str1='education department' >>>print(str1.title()) Education Department |
17.
(i) Save Earth
(ii) sAVE eARTH
18.
| center (width, fillchar) | Returns a string with the original string centered to a total of width columns and filled with fillchar in columns that do not have characters |
>>> strl="Welcome" >>> print(strl center(15,'*')) ****Welcome**** |
19.
(i) Learn
(ii) r
(iii) er
(iv) ceoenyo
20.
strl ="COMPUTER"
index = 0
for i in strl:
print (strl [:index+ 1])
index+=I
21.
(i) T
(ii) THIRU
(iii) THIRU
(iv) KURAL
22.
(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.
23.
24.
Python will not allow deleting a particular character in a string. Whereas you can remove entire string variable using del command.
Example :
>>> strl="How about you"
>>> print (str1)
How about you
>>> del str1
>>> print (str1)
Traceback (most recent call last):
File "
print (strl)
NameError : name 'str1' is not defined
25.
(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""
26.
Membership Operators:
(i) The 'in' and 'not in' operators can be used with strings to determine whether a string is present in another string. Therefore, these operators are called as Membership Operators.
(ii) Example:
str1=input ("Enter a string:")
str2="chennai"
if str2 in str1:
print ("Found")
else:
print ("Not Found")
(iii) Output:1
Enter a string: Chennai GHSS, Saidapet
Found
(iv) Output:2
Enter a string: Govt GHSS, Ashok Nagar Not Found
27.
| 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()) |
28.
(i) python
(ii) false
(iii) false
(iv) PYTHON
29.
(i) False
(ii) False
(iii) False
30.
(i) 0
(ii) 3
(iii) -1
(iv) 3
31.
(i) 11
(ii) School
(iii) * * * * Welcome * * * *
32.
(i) carriage return
(ii) character with octal value
(iii) vertical tab
33.
(i) character
(ii) Signed decimal integer
(iii) String
34.
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
35.
str1 = input ("Enter a string:")
Index=-1
while index >= -(lentstrl1)):
print ("Subscript[",index,"] :" + str1 [index])
index +=-1
Output:
Enter a string: welcome
Subscript [ -1 ] : e
Subscript [ -2 ] : m
Subscript [ -3 ] : 0
Subscript [ -4 ] : c
Subscript [ -5 ] : I
Subscript [ -6 ] : e
Subscript [ -7 ] : w
36.
The positive subscript 0 is assigned to the first character and n-1 to the last character, where n is the number of charaters in the string. The negative index assigned from the last character to the first character in reverse order begins with -1.
Example:
| String | S | C | H | O | O | L |
| Positive subscript | 0 | 1 | 2 | 3 | 4 | 5 |
| Built in functions | -6 | -5 | -4 | -3 | -2 | -1 |
37.
| 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 |
38.
(i) The format( ) function used with strings is very versatile and powerful function used for formatting strings.
(ii) The curly braces {} are used as placeholders or replacement fields which get replaced along with format( ) function.
Example:
num1 = int (input("Number 1:"))
num2 = int (input("Number 2:"))
print ("The, sum of {} and {} is {}". format (num1, num2, (num1 + num2)))
Output:
Number 1: 34
Number 2: 54
The sum of 34 and 54 is 88.
39.
| Syntax | Description | Example |
| (a) capitalize() | Used to capitalize the first character of the string | >>> city="chennai" >>> print(city, capitalize( )) Chennai |
| (b) swapcase( ) | It will change case of every character to its opposite case vice-versa. | >>> strl="tAmilL NaDu" >>>print(strl.swapcase( )) TaMIl nAdU |
40.
Str 1 = "COMPUTER"
index = 0
for i in str 1:
print (str 1[:index -1])
index =1
41.
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.
42.
strl=' * '
i=1
while i< = 5:
print (strl*i)
i+=1
43.
str1 = input ("Enter a string:")
str2 ="
index=-1
for i in str1:
str2 += str1[index]
index -=1
print ("'The given string = {} \n The Reversed string = {}".format(str1, str2))
if (str1==str2):
print ("Hence, the given string is Palindrome")
else:
print ("Hence, the given is not a palindrome")
Output:1
Enter a string: malayalam
The given string = malayalam
The Reversed string = malayalam
Hence, the given string is Palindrome
Output: 2
Enter a string: welcome
The given string = welcome
The Reversed string = emoclew
Hence, the given string is not a palindrome
44.
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
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