Question 6 of 22beginner💡 UnderstandShort Answer2 marks

Which data type will be used to represent the following data values and why?

(a)

Number of months in a year

Answer

int - Number of months in a year is always 12, which is a whole number. The context shows int stores integer numbers like -12, -3, 0, 125, 2.

(b)

Resident of Delhi or not

Answer

bool - Resident of Delhi or not has only two possible values (yes/no). The context states Boolean data type consists of two constants True and False.

(c)

Mobile number

Answer

int - Mobile number is a numeric value without decimal points. The context shows int stores integer numbers.

(d)

Pocket money

Answer

float - Pocket money can have decimal values (like Rs. 500.50). The context states float stores real or floating point numbers like -2.04, 4.0, 14.23.

(e)

Volume of a sphere

Answer

float - Volume of a sphere involves calculations that typically result in decimal values. The context shows float stores real numbers.

(f)

Perimeter of a square

Answer

float - Perimeter of a square can have decimal values depending on side length. The context states float stores real or floating point numbers.

(g)

Name of the student

Answer

string - Name of the student is textual data. The context mentions strings in examples like 'Paper', 'Gel Pen'.

(h)

Address of the student

Answer

string - Address of the student is textual data containing letters, numbers and symbols. The context mentions strings in examples.

Explanation

This question tests understanding of Python data types from the context. The context clearly defines int (integer numbers), float (real/floating point numbers), and bool (True/False values). For textual data like names and addresses, string data type is appropriate as mentioned in the context examples. The key is matching the nature of data (whole number, decimal, true/false, text) with the appropriate data type.