You are on page 1of 1

SCHOOL OF ADVANCED SCIENCES

DEPARTMENT OF MATHEMATICS
FALL SEMESTER 2021∼2022
CBS1009 – Computational Statistics
Quiz–L5+L6 Slot

Instructions:
• Write roll number and name on the top of the answer sheet. If you don’t mention your
roll number, your answer sheet won’t be evaluated.
• Each questions carries 1 mark
• Duration of the Quiz is 15 minutes

1. What is a correct syntax to output ”Hello World” in Python?


(a) echo ”Hello World” (b) echo(”Hello World”);
(c) print(”Hello World”) (d) p(”Hello World”)
2. What is the correct file extension for Python files?
(a) .pyth (b) .pyt (c) .pt (d) .py
3. Which operator is used to multiply numbers?
(a) % (b) ∗ (c) x (d) #
4. Which of these collections defines a LIST?
(a) {”apple”, ”banana”, ”cherry”} (b) {”name”: ”apple”, ”color”: ”green”}
(c) (”apple”, ”banana”, ”cherry”) (d) [”apple”, ”banana”, ”cherry”]
5. Which of these collections defines a SET?
(a) {”apple”, ”banana”, ”cherry”} (b) {”name”: ”apple”, ”color”: ”green”}
(c) (”apple”, ”banana”, ”cherry”) (d) [”apple”, ”banana”, ”cherry”]
6. How do you start writing a while loop in Python?
(a) while x > y (b) while x > y: (c) while (x > y) (d) x > y while
7. Which of the following is not a keyword in Python?
(a) break (b) while (c) continue (d) operators
8. A Function which calls itself is called as
(a) Built-in (b) Recursion (c) Lambda (d) return
9. Let list=[2,4,6,8,10], then print(list[-2]) will result in
(a) 10 (b) 8 (c) 4 (d) 6
10. What will be the result of the following Python code:
S=[x**2 for x in range(5)]
print(S)
(a) [0,1,2,4,5] (b) [0,1,4,9,16] (c) [0,1,4,9,16,25] (d) [1,4,9,16,25]

You might also like