menu

Python Basics

Python Basics - Important Points


11. Which of the following is NOT a data type in Python?

A. Integer

B. Float

C. Double

D. String

Discuss Work Space

Answer: option c

Explanation:

Python does not have a Double data type, but it has a Float data type.

12. Which of the following is a valid Python variable name?

A. 1_name

B. my_variable

C. $test

D. class

Discuss Work Space

Answer: option b

Explanation:

Python variable names must start with a letter or underscore, and can contain letters, numbers, and underscores.

13. Which of the following is NOT a valid way to declare a variable in Python?

A. x = 1

B. y = "Hello"

C. z = 3.14

D. 2 = a

Discuss Work Space

Answer: option d

Explanation:

Variables cannot be declared with a numeric value on the left side of the equals sign.

14. Which of the following is the correct way to define a multi-line string in Python?

A. This is a multi-line string

B. '''This is a multi-line string'''

C. "This is a multi-line string"

D. All of the above

Discuss Work Space

Answer: option c

Explanation:

Triple quotes are used to define multi-line strings in Python.

15. Which of the following is an example of a mutable data type in Python?

A. Integer

B. Float

C. String

D. List

Discuss Work Space

Answer: option d

Explanation:

Lists in Python are mutable, which means their values can be changed.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now