Pt1 Xii Cs Complete in Word
Pt1 Xii Cs Complete in Word
Pt1 Xii Cs Complete in Word
a) 10#40#70#
b) 30#40#50#
c) 40#50#70#
d) 50#60#70#
5. Find the output of the following code?
If name="ComputerSciencewithPython"
Then output of print(name[3:10]) will be-
a) puterSc
b) mputerScie
c) Compute
d) puterScie
6. The Python Library modules which needs to be imported to invoke the ceil() functions:
a) maths
b) random
c) statistics
d) math
7. What will be the correct output among the given options for the following statements?
STR=”VIBGYOR” colors=list(STR)
>>>del colors[4]
>>>colors.remove("B")
>>>colors.pop(3)
>>>print(colors)
12 Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80), which of the following is incorrect?
a) print(Tup[1])
b) Tup[2] = 90
c) print(min(Tup))
d) print(len(Tup))
13 The built-in mathematical function / method that is used to return square root of a number-
a) Squareroot()
b) Sqrt()
c) Square()
d) Root()
14 Which keyword is used to access a global variable inside the function, if function has a
variable with same name?
a) Nonlocal
b) def
c) args
d) global
15 The area of program where a variable has a valid value is called ______
a) Life time
b) Scope
c) Parameter
d) Global area
On the basis of the above code, choose the right statement which will be executed when
different inputs for pay and location are given.
i) Input: location = "Chennai”, pay = 50000
a. Statement 1
b. Statement 2
c. Statement 3
d. Statement 4
ii) Input: location = "Surat" ,pay = 50000
a. Statement 2
b. Statement 4
c. Statement 5
d. Statement 6
iii) Input- location = "Any Other City", pay = 1
a Statement 1
b. Statement 2
c. Statement 4
d. Statement 6
iv) Input location = "Delhi", pay = 500000
a. Statement 6
b. Statement 5
c. Statement 4
d. Statement 3
v) Input- location = "Lucknow", pa y = 65000
a. Statement 2
b. Statement 3
c. Statement 4
d. Statement 5
SECTION - II
(1 MARKER QUESTIONS)
22. What is the output of the below program? (1)
def say(message, times = 1):
print(message * times)
say('Hello')
say('World', 5)
23. Declare a dictionary Color, whose keys are 1, 2, 3 and values are Red, Green and Blue
respectively. (1)
(2 MARKER QUESTIONS)
24. What is the difference between actual and formal parameters? Explain with example.(2)
25. Observe the following Python code very carefully and rewrite it after removing all syntactical
errors with each correction underlined. (2)
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
execmain()
27. If given A=2,B=1,C=3, What will be the output of following expressions: (2)
(i) print((A>B) and (B>C) or(C>A))
(ii) print(A**B**C)
28. What will be the output of following code: (2)
def Alter(x, y = 10, z=20):
sum=x+y+z
print(sum)
Alter(10,20,30)
Alter(20,30)
Alter(100)
(3 MARKER QUESTIONS)
29. Write a function listchange(Arr) in Python, which accepts a list Arr of numbers, the function
will replace the even number by value 10 and multiply odd number by 5 . (3)
Sample Input Data of the list is:
a=[10, 20, 23, 45]
listchange(a) output : [10, 10, 115, 225]
**********ALL THE BEST ***********