0% found this document useful (0 votes)
3 views

Module 5 Worksheet 1

This document is a worksheet containing a series of questions related to Python programming concepts, including data types, mutable vs immutable objects, and dictionary operations. It includes multiple-choice questions, fill-in-the-blank sections, and matching exercises. The content is designed to assess knowledge of Python syntax and functionality.

Uploaded by

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

Module 5 Worksheet 1

This document is a worksheet containing a series of questions related to Python programming concepts, including data types, mutable vs immutable objects, and dictionary operations. It includes multiple-choice questions, fill-in-the-blank sections, and matching exercises. The content is designed to assess knowledge of Python syntax and functionality.

Uploaded by

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

Module 5 Worksheet 1

Q.No 1. Which typecode is used to represent signed integer of 1 Byte?

a) b

b) i

c) B

d) I

Answer:

Q.No 2. Tuple Objects are mutable?

a) True

b) False

Answer:

Q.No 3. What is the result of y=x*3 where x=[2,3]?

a) [2,3,3]

b) [6,9]

c) [2,3,2,3,2,3]

d) [2,3][2,3][2,3]

Answer:

Q.No 4. Square brackets in an assignment statement will create which type of data structure?

( s=[] )

a) List

b) queue

c) set

d) dictionary
Answer:

Q.No 5. To insert an the string "strawberries" in the first position of a list we use

a) fruit.append("strawberries, 1")

b) fruit.insert("strawberries",0)

c) fruit.insert(1, "strawberries")

d) fruit.insert(0, "strawberries")

Answer:

Q.No 6. Select the all correct way to remove the key marks from a dictionary

a) student.popitem("marks")

b) student.pop("marks")

c) del student["marks"]

d) student.remove("marks")

Answer:

Q.No 7. In Python, Dictionaries are immutable

a) True

b) False

Answer:

Q.No 8. Items are accessed by their position in a dictionary and All the keys in a dictionary must
be of the same type.

a) True

b) False

Answer:

Q.No 9. The "pass" statement in Python is used for?

a) Terminating a loop
b) Skipping the current iteration of a loop

c) Creating an empty function or class

d) Exiting the program

Answer:

Q.No 10. What is the purpose of the base conversion algorithm?

a) Sorting

b) Changing the data type of a variable

c) Converting a number from one numeral system to another

d) Calculating the power of a number

Answer:

Fill in the blanks

Q. No1. Dictionaries use _________ and keys are separated with _________

Answer:

Q.No.2. Comparing a dictionary to Python to a dictionary for words, ____________ is each word we look
up_______ is definition of the word

Answer:

Q.No.3. ______________ can be strings, integers and lists

Answer:

Q.No.4. The keyword used for conditional statements with multiple branches in Python is _______.

Answer:

Q.No.5. The _______ algorithm is used for reversing a list in Python.

Answer:
Match the following

PART A PART B ANSWER

(1) Factorial Computation (A) Changing the numeral system of a number

(2) Iteration (B) Early termination of a loop

(3) Base Conversion (C) Computing the product of consecutive integers

(4) if-elif-else (D) Conditional statements with multiple branches

(5) Reverse (E) Inverting the order of elements in a sequence

Answer

You might also like