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/12/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.
Which of the following is used to access and manipulate the strings
Index value
Subscript
Argument
Parameters
a or b
2.
String index values are also called as
class
function
subscript
arguments
3.
Which of the following is used as placeholders or replacement fields which get replaced along with format( ) function?
{ }
< >
++
^^
4.
Which of the following is the slicing operator?
{ }
[ ]
< >
( )
5.
Strings in python:
Changeable
Mutable
Immutable
flexible
6.
Write a note on the function center ().
7.
What is meant by stride?
8.
Write the general format of slice operation.
9.
10.
Do you modify a string in Python?
11.
With an example program explain about membership operators?
12.
Write the output of the following statements.
(i) 'Python 2.3' . isalpha ()
(ii) 'Python Program' . is alnum ()
(iii) 'Python' . isupper ()
13.
Write the output of the following statements.
(i) print (len ("Corporation"))
(ii) print ("school", Capitalize ())
(iii) print ("Welcome" center (15, '*'))
14.
Write a program to accept a string and print it in reverse order.
15.
What will be the output of the given python program?
str1 = "welcome"
str2 = "to school"
str3 = str1[:2] + str2[len(str2)-2:]
print (str3)
16.
Write a python program to display the number of vowels and consonants in the given string.
17.
Write a python program to check whether the given string is palindrome or not.
1.
(e)
a or b
2.
(c)
subscript
3.
(a)
{ }
4.
(b)
[ ]
5.
(c)
Immutable
6.
| 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**** |
7.
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.
8.
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.
9.
10.
Strings in python are immutable. That means, once you define a string moditications or deletion is not allowed. However, we can replace the existing string entirely with the new string.
11.
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
12.
(i) False
(ii) False
(iii) False
13.
(i) 11
(ii) School
(iii) * * * * Welcome * * * *
14.
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
15.
Output:
Weool
16.
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.
17.
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
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