12th Computer Science Public Exam Important Program Question 2023
12th Computer Science Public Exam Important Program Question
- Hi students we post 12th Computer Science Public Exam Important Program Question 2023.
- This post is helpful for you to attend the programming questions and to get centum in board exams.
- Try to go through the hands on practice questions, and book back programs too
In python programming questions are covered under the topics:
- List
- Tuple
- String slicing
- Class and object
- Inheritance
- Pattern using for loop
- Pyplot
- Overloading
Model Program:
- What will be output of the given python program?
Str= “COMPUTER SCIENCE”
- a) pirnt(str*2) b) print(str[0:7])
- What will be the output of the following code?
list=[3**x for x in range(5)]
print(list)
- Write the output of the following program.
Class hosting:
def__init__(self, name):
self.__name=name
def display(self):
print(“Welcome to”, self.__name)
obj=hosting(“Python programming)
obj.display()
- What will be the output of the given python program?
a= “computer”
b= “science”
x=a[:4]+b[len(b)-3:]
- Write the output for the following program.
i=0
while(i<=6):
for j in range(1,i)
print(j, end=’\t’)
print(end= ‘\n’)
i+=1
- Write the output for the following python commands
Str1= “Welcome to Python”
- i) print(str1)
- ii) print(str1[11:17])
iii) print(str1[11:17:2])
- iv) print(str2[: :4])
- v) print(str1[: : -4])
8. Write the output for the following python programs
i) j=15
while(j>=10):
print(j, end= ‘\t\’)
j=j-1
else:
print(“\ end of the loop)
ii) k=15
while(k<=9):
for i in range(1,k):
print(i, end= ‘\t\’)
k=k+1
- Debug the following program to get the given output:
Output:
Inside add() function x value is:10
In main x value is:10
Program:
x=0
define add:
globally x:
x=x+10
print(“inside add()function x value is:”)
add
print(“In main x value is:”)
- Program to check if the accepted number odd or even
a = int(input(“Enter any number :”))
if a%2==0:
print (a, ” is an even number”)
else:
print (a, ” is an odd number”)
11. Program to access each character with its positive subscript of a giving string
str1 = input (“Enter a string: “)
index=0
for i in str1:
print (“Subscript[“,index,”] : “, i)
index + = 1
12. Program to slice substrings using for loop
str1=”COMPUTER”
index=0
for i in str1:
print (str1[:index+1])
index+=1
13. What will be output of the following python snippet?
Str1=”THOLKAPPIYAM”
Print(str1[4:])
Print(str1[4::2])
Print(str1[::3])
Print(str1[::-3])
14. Draw the chart for the given python snippet.
Import matplotlib. Pyplot as plt
Plt.plot([1,2,3,], [1,4,9,16])
Plt.show()
[pdf-embedder url=”https://csknowledgeopener.com/wp-content/uploads/2023/01/XII-CS-EM-PROGRAM-QUESTION-2022-2023.pdf” title=”XII – CS EM PROGRAM QUESTION 2022-2023″]