WORKSHEET 5
PYTHON
Objective Questions (MCQs)
1. What is the default return type of the input() function in Python?
A. Integer
B. Float
C. String
D. Depends on user input
2. Which of the following is mutable in Python?
A. int
B. float
C. tuple
D. list
3. What will be the output of this code?
set1 = {1, 2, 3, 4, 4}
print(set)
A. {1, 2, 3, 4, 4}
B. {1, 2, 3, 4}
C. {4, 4, 3, 2, 1}
D. No output
4. What does the following code do?
print("hello", "world", sep="@")
A. Prints hello world
B. Prints hello@world
C. Prints hello world@
D. Prints @hello@world@
5. Which data type uses key-value pairs?
A. list
B. tuple
C. dictionary
D. set
Short Answer Questions
1. What is the difference between dynamic typing and static typing? Give one example of each.
2. Explain the concept of indentation in Python and its importance in defining code blocks.
3. How do you declare a variable in Python? Give examples of string, integer, and float
variables.
4. What will be the output of the following code? Explain your answer.
x = "Aman"
y=x/2
5. Define and differentiate between mutable and immutable data types in Python with examples.