0% found this document useful (0 votes)
49 views4 pages

Xiicomp SC Pt1458

Uploaded by

vikas10srini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views4 pages

Xiicomp SC Pt1458

Uploaded by

vikas10srini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UTTARAKHAND PUBLIC SCHOOL , NOIDA

UNIT TEST-1 (2024-25)


COMPUTER SCIENCE(083)
CLASS-XII
SET-B

S.n SECTION-A Marks


o
1 State True or False “Python language is Cross platform language.” 1
2 Predict the output. 1
marks = {"Ashok":98.6, "Ramesh":95.5}
print(list(marks.keys()))
(a) ‘Ashok’, ‘Ramesh’
(b) 98.6, 95.5
(c) [‘Ashok’,’Ramesh’]
(d) (‘Ashok’,’Ramesh’)
3 Consider the given expression: not ((True and False) or True) 1
Which of the following will be correct output if the given expression is evaluated?
(A) True (B) False (C) NONE (D) NULL
4 Write the output:- 1
myTuple = ("John", "Peter", "Vicky")
x = "#".join(myTuple)
print(x)
(a) #John#Peter#Vicky
(b) John#Peter#Vicky
(c) John#Peter#Vicky#
(d) #John#Peter#Vicky#

5 Which of the following statement(s) would give an error after executing the following 1
code?
D={'rno':32,'name':'Ms Archana','subject':['hindi','english','cs'],'marks':(85,75,89)} #S1
print(D) #S2
D['subject'][2]='IP' #S3
D['marks'][2]=80 #S4
print(D) #S5
(A) S1 (B) S3
(C) S4 (D) S3 and S4
6 Select the correct output of the following python code: 1
str="My program is program for you"
t = str.partition("program")
print(t)
a) ('My ', 'program', ' is ', 'program', ' for you')
b) ('My ', 'program', ' is program for you')
c) ('My ', ' is program for you')
d) ('My ', ' is ', ' for you')
7 Which of the following statement(s) would give an error after executing the following 1
code?
S="Welcome to my python program" # Statement 1
print(S) # Statement 2
S="Python is Object Oriented programming" # Statement 3
S= S * “5” # Statement 4
S=S+"Thank you" # Statement 5
(a) Statement 3
(b) Statement 4
(c) Statement 5
(d) Statement 4 and 5
8 Select the correct output of the code: 1
for i in "QUITE":
print([i.lower()], end= "#")
(a) q#u#i#t#e#
(b) [‘quite#’]
(c) ['q']#['u']#['i']#['t']#['e']#
(d) [‘quite’] #
9 What will the following expression be evaluated to in Python? 1
print(2**3 + (5 + 6)**(1 + 1))
(a) 129 (b)8 (c) 121 (d) None
10 What will be the Output for the following code – 1
Language=["C", "C++", "JAVA", "Python", "VB", "BASIC", "FORTRAN"]
del Language[4]
Language.remove("JAVA")
Language.pop(3)
print(Language)
(a) ['C', 'C++', 'VB', 'FORTRAN']
(b) ['C', 'C++', 'Python', 'FORTRAN']
(c) ['C', 'C++', 'BASIC', 'FORTRAN']
(d) ['C', 'C++', 'Python', 'BASIC']
11 What will be the value of y when following expression be evaluated in Python? 1
x=10.0
y=(x<100.0) and x>=10
(a)110 (b) False (c)Error (d)True
12 Which of the following is valid arithmetic operator in Python: 1
(a) // (b) ? (c ) < (d) and
13 string= "it goes as - ringa ringa roses" 1
sub="ringa"
string.find(sub,15,22)
(a) 13 (b)-13 (c) -1 (d) 19
14 Assertion (A):- key word arguments are related to the function calls. 1
Reasoning (R):- when you use keyword arguments in a function call, the caller
identifies the arguments by parameter name
15 Assertion (A):- If the arguments in a function call statement match the number and 1
order of arguments as defined in the function definition, such arguments are called
positional arguments.
Reasoning (R):- During a function call, the argument list first contains default
argument(s) followed by positional argument(s).
16 1.What will be the output of the following python statement? 1
L=[3,6,9,12]
L=L+15
print(L)
(a)[3,6,9,12,15] (b) [18,21,24,27] (c) [5,3,6,9,12,15] (d) error
SECTION-B
17 Observe the following Python code very carefully and rewrite it after 2
removing all syntactical errors with each correction underlined.
DEF execmain():
x = input("Enter a number:")
if (abs(x)== x)
print("You entered a positive number")
else:
x=*1
print("Number made positive:" x )
18 (a) Given is a Python string declaration: 2
str="CBSE Examination@2022"
Write the output of: print(str[-1:-15:-2])

(b) Write the output of the code given below:


d = {"name": "Akash", "age": 16}
d['age'] = 27
d['city'] = "New Delhi"
print(d.items())
19 def change(m, n=10): 2
global x
x+=m
n+=x
m=n+x
print(m,n,x)
x=20
change(10)
change(20)
20 def fun(s): 2
k=len(s)
m=" "
for i in range(0,k):
if s[i].isupper():
m=m+s[i].lower()
elif s[i].islower():
m=m+s[i].upper()
elif s[i].isdigit():
m=m+"O"
else:
m=m+'#'
print(m)
fun('CBSE@12@Exam')
21 defmy_func(var1=100,var2=200): 2
var1+=10
var2 =var2-10
returnvar1+var2
print(my_func(50),my_func())
SECTION-C
22 (a) Given is a Python string declaration: 3
str="malayalam"
Write the output of print(str[ : :-1])

(b) Write the output of the code given below:


Employee1={'name':'John','salary':10000,'age':24}
Employee2={'name':'Divya','salary':54000,'dept':'Sales'}
Employee1.update(Employee2)
print(Employee1)
23 (a) Given is a Python string declaration: 3
message="Bring it on!!!"
Write the output of: print(message[::-2])

(b) Write the output of the code given below:


book_dict = {"title": "You can win", “copies”:15}
book_dict['author'] = “Shiv Khera”
book_dict['genre'] = "Motivation"
print(book_dict.items())
24 (a)GivenisaPythonstring declaration: 3
Str1="##NEETExamination2023##"
Write theoutputof:print(Str1[::-1])

(b)Writetheoutputofthe codegivenbelow:
D1 ={"sname":"Aman","age":26}
D1['age']=27
D1['address']=
"Delhi"
print(D1.items())

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy