Question Bank Subject: Computer Science: Class: XII Sub. Code: 083
Question Bank Subject: Computer Science: Class: XII Sub. Code: 083
Question Bank Subject: Computer Science: Class: XII Sub. Code: 083
CHAPTERS
Python Revision Tour
Functions
s='sCHool2@com'
k=len(s)
m=""
for i in range(0,k):
if(s[i].isupper()):
m=m+s[i].lower()
elif s[i].isalnum():
m=m+s[i]
else:
m=m+'bb'
print(m)
3. Considet two tuples T1=(1,2,4) and T2=(8,9). What will be the result T2+T1?
a) (1,2,4,8,9) b) (8,9,1,2,4) c) 24 d)Results into an error
4. Given a function that does not return any value, what value is thrown by default
when executed in shell?
a) int b) bool c) void d) None
1
a) Syntax Error b) NameError c) ValueError d) TypeError
14. What will be the output when the following code is executed?
x=100
def func(x):
x=2
func(x)
print(x)
a)2 b)100 c)SyntaxError d)102
15. What will be the output of below Python code?
2
def func(a,b=5,c=10):
print('a is',a,'and b is',b,'and c is',c)
func(3,7)
func(25,c=24)
a) a is 7 and b is 3 and c is 10
a is 25 and b is 5 and c is 24
b) a is 3 and b is 7 and c is 10
a is 5 and b is 25 and c is 24
c) a is 3 and b is 7 and c is 10
a is 25 and b is 5 and c is 24
d)None of these
17. Which of the following is a function call for the function named ‘func’?
a) call func()
b) def func()
c) func()
d) None of the above
18. Functions that are already defined in python is called________
a) user defined functions
b) library functions
c) built-in functions
d) Both b and c
19. Which of the following statement is not true regarding functions?