0% found this document useful (0 votes)
4 views3 pages

Assignment 3 - Python Data Types & Operators

The document outlines an assignment focused on Python data types and operators, divided into three parts: conceptual questions, multiple-choice questions, and brainstorming tasks. It covers topics such as basic data types, mutable vs immutable types, and various operators. Additionally, it includes programming tasks to apply the concepts learned.

Uploaded by

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

Assignment 3 - Python Data Types & Operators

The document outlines an assignment focused on Python data types and operators, divided into three parts: conceptual questions, multiple-choice questions, and brainstorming tasks. It covers topics such as basic data types, mutable vs immutable types, and various operators. Additionally, it includes programming tasks to apply the concepts learned.

Uploaded by

Bhuma Nithisha
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment 3: Python Data Types & Operators

Part A: Conceptual (Q1–Q8)

1. List the basic built-in data types in Python.

2. Differentiate between mutable and immutable data types.

3. What is the difference between list and tuple?

4. Define dictionary and give an example.

5. Explain the difference between is and ==.

6. What is type casting? Give an example.

7. List arithmetic operators in Python.

8. What are logical operators in Python?

Part B: MCQs (Q9–Q16)

9. Which of these is a mutable type?


a) str
b) tuple
c) list
d) int

10. What is the output?

print(type(5/2))

a) int
b) float
c) double
d) None
11. Which operator is used for floor division?
a) /
b) //
c) %
d) **

12. What will 7 % 3 return?


a) 1
b) 2
c) 3
d) Error

13. Which operator checks object identity?


a) ==
b) is
c) in
d) !=

14. Which is correct about Python booleans?


a) True = 1, False = 0
b) True = 0, False = 1
c) Both are strings
d) None

15. What is the output?

print(2 ** 3 ** 2)

a) 64
b) 512
c) 256
d) Error

16. Which data type can store key-value pairs?


a) list
b) tuple
c) dict
d) set
Part C: Brainstorming (Q17–Q25)

17. Write a program that converts Celsius to Fahrenheit.

18. Write a program to demonstrate membership operator in.

19. Predict output:

x = [1, 2, 3]
y = [1, 2, 3]
print(x == y, x is y)

20. Write code to check if a number is even using operators.

21. Store marks of 5 subjects in a list and calculate average.

22. Which operator would you use to check if a number lies between 10 and 20?

23. Show difference between / and // operators with an example.

24. Explain why strings are immutable in Python with example.

25. Write a program that uses all arithmetic operators on two numbers.

You might also like