0% found this document useful (0 votes)
3 views2 pages

Worksheet5(on Python)

The document is a worksheet containing objective questions and short answer questions related to Python programming. It includes multiple-choice questions about the input function, mutable types, set outputs, string formatting, and key-value pairs, as well as short answer questions on typing, indentation, variable declaration, and data types. The worksheet aims to assess knowledge of fundamental Python concepts.

Uploaded by

Ansh
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)
3 views2 pages

Worksheet5(on Python)

The document is a worksheet containing objective questions and short answer questions related to Python programming. It includes multiple-choice questions about the input function, mutable types, set outputs, string formatting, and key-value pairs, as well as short answer questions on typing, indentation, variable declaration, and data types. The worksheet aims to assess knowledge of fundamental Python concepts.

Uploaded by

Ansh
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
You are on page 1/ 2

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy