Xii CS Tour 1&2-Worksheet
Xii CS Tour 1&2-Worksheet
Xii CS Tour 1&2-Worksheet
1. Ram is trying to write a program on reversing the string he couldn’t able to complete the code.
Help him by writing code for him. (Competency based – Program writing)
2. Find the output for the following code. (Competency based)
5. There is a list called word=[‘I am a code’, ‘awesome’, ‘we all gathered for a reason’]. Write a
program to re-arrange this list of sentence in descending order based on the length of the
sentence. (Competency based – Program writing)
6. Write a program to print entire lower case alphabets from a to z. Note: You can only declare
the starting alphabet not all the alphabets. (Competency based – Program writing)
7. If there is an argument starting with ** in function header, what type of argument it is? (MCQ)
a. Variable length argument c. Positional argument
b. Keyword variable length argument d. Keyword argument
8. Write output of the following code
11. Fill in the blanks, so the below code will produce the output “Max” (Competency based)
12. Rewrite the code without errors and write the output of below code (Competency based)
15. Find error in the following code(if any) and correct code by rewriting code and underline the
correction: (Finding error)
16. The below code is to convert the list of sentence to list of words. Fill in the blanks so the code
works in desired way. (Competency based – Fill up ½ mark for each)
18. The below code is to convert the given string in alphabetic order. Fill in the blanks so the code
works properly. Example: if ‘apple’ is the input, the output will be ‘aelpp’ (Competency based –
Fill up ½ mark for each)
19. Among the given option choose the correct function that does not belong to string datatype.
(MCQ)
a. strip() b. index() c. replace() d. reverse()
20. In string slicing starting index and stop index is also called as ______________ (Fill in the
blanks)
Velammal Bodhi Campus – Kumbakonam (Hariharan S, Herold R A)
21. Which of the following options is a keyword?
a. Def b. true c. False d. Break
22. Which of the following options is a relational operator?
a. = b. %= c. >= d. +=
23. Which of the following options is an identifier?
a. Roll no b. Stu_name c. math+mark d. def
24. What is the size of the string ‘Seema\’s pencil’?
a. 15 b. 14 c. 12 d. 13
25. Which of the following are valid real literals?
a. 7 b. 27.0 c. +17/2 d.17,203.50
26. Assertion (A): None literal is used to indicate absence of values.
Reason (R ): It is equal to zero. (Competency based – MCQ)
a. Both (A) and (R ) are correct
b. Both (A) and (R ) are not correct
c. (A) is correct, but (R ) is not correct
d. (A) is not correct, but (R ) is correct
27. Assertion (A): Numeric values with commas are not considered as int or float values..
Reason (R ): Python treats such values as tuples. (Competency based – MCQ)
a. Both (A) and (R ) are correct
b. Both (A) and (R ) are not correct
c. (A) is correct, but (R ) is not correct
d. (A) is not correct, but (R ) is correct
28. Which of the following is an expression in b=a-5?
a. b b. 5 c. a-5 d. b=a-5
29. Which of the following statement is correct?
a. 20=b b. 20-b c. a*2=c d. b=2*a
30. Which of the following functions is used to check the datatype of literals?
a. id() b. datatype() c. dtype() d. type()
31. Which of the following functions is used to get the input from the user?
a. Input() b. get() c. read() d. none of these
32. The output of the following code is
a,b=5,10
print(‘a=’,a,end=’,’)
print(‘b=’,b)
a. 5,10 b. 5 c. 5, d. 10
10 10 5
33. Which of the following is the correct statement?
a. a=input(Enter your name) c. a=input “Enter your name”
b. a=input(Enter your name d. a=input(“Enter your name”)
34. Names given to a part of a program are _____________.
a. identifiers b. keywords c. functions d. literals
35. A __________ is a reserved word carrying special meaning and purpose.
a. identifiers b. keywords c. literals d. functions
a. 6 b. 1 c. 4 d. 5
42. What will be the output of the following code? (Competency based – MCQ)