Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Python one mark

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
14-03-2025
Written in
2024/2025

This can learn about all the one marks in the subject like the computer subject related to python and you can get score at least 70% by one mark by referring these kind of materials

Institution
Course

Content preview

Q1. What is the data type of the variable “x” in the following code snippet?

x=5

a) Integer

New Feature Beta

Personalized GenAI Learning Path 2025 Crafted Just for YOU!

b) String

c) Float

d) Boolean

Answer: a

Explanation: The variable “x” is assigned an integer value, so its data type is Integer.

Q2. What will be the output of the following code snippet?

x = "Hello"

print(type(x))

a) hello

b) str

c) string

d) String

Answer: b

Explanation: The code snippet prints the data type of the variable “x”, which is a string. The correct
type name in Python is “str”.

Q3. Which data type in Python is used to store a sequence of characters?

a) Integer

b) Float

c) String

d) Boolean

Answer: c

Explanation: Strings are used to store sequences of characters in Python.

Q4. What is the output of the following code snippet?

x = 3.14

print(type(x))

a) int

,b) Integer

c) float

d) Float

Answer: c

Explanation: The code snippet prints the data type of the variable “x”, which is a floating-point
number. The correct type name in Python is “float”.

Q5. Which data type is used to store a collection of items, where each item is indexed by a key?

a) List

b) Tuple

c) Set

d) Dictionary

Answer: d

Explanation: Dictionaries in Python are used to store collections of items where each item is indexed
by a key.

Q6. What will be the output of the following code snippet?

x = 10

y = "20"

print(x + int(y))

a) 30

b) 1020

c) “1020”

d) Error

Answer: a

Explanation: The code snippet converts the string “20” to an integer using the int() function and then
adds it to the integer value of “x”. Therefore, the output will be 30.

Q7. Which data type in Python is mutable?

a) String

b) Tuple

c) Set

d) List

Answer: d

, Explanation: Lists in Python are mutable, meaning their elements can be changed after they are
created.

Q8. What will be the output of the following code snippet?

x = {"apple", "banana", "cherry"}



print(type(x))

a) set

b) Set

c) list

d) List

Answer: a

Explanation: The code snippet prints the data type of the variable “x”, which is a set. The correct
type name in Python is “set”.

Q9. Which data type is used to store a collection of items, where each item is unique and
unordered?

a) List

b) Tuple

c) Set

d) Dictionary

Answer: c

Explanation: Sets in Python are used to store collections of items where each item is unique and
unordered.

Q10. What is the output of the following code snippet?

x = {"name": "John", "age": 30}



print(type(x))

a) dictionary

b) dict

c) Dictionary

d) Dict

Answer: b

Explanation: The code snippet prints the data type of the variable “x”, which is a dictionary. The
correct type name in Python is “dict”.

Written for

Institution
Secondary school
Course
School year
1

Document information

Uploaded on
March 14, 2025
Number of pages
17
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.39
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
mmonesh

Get to know the seller

Seller avatar
mmonesh
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
3
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions