CBSE Class 11 Informatics Practices Question 61 of 102

Python Programming Fundamentals — Question 22

Back to all questions
22
Question

Question 17

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

(a) Number of months in a year

(b) Resident of Delhi or not

(c) Mobile number

(d) Pocket money

(e) Volume of a sphere

(f) Perimeter of a square

(g) Name of the student

(h) Address of the student

Answer
S.
No.
Data ValueData TypeReason
(a)Number of months in a yearintA year has 12 months which is a whole number
(b)Resident of Delhi or notboolIt is a true or false value
(c)Mobile numberstrMobile numbers can contain leading zeros and may include country codes, so they are stored as strings.
(d)Pocket moneyfloatMoney can be a decimal value.
(e)Volume of a spherefloatVolume of a sphere is calculated using the formula ((4/3) * (22/7) * (r ** 3)) , which often results in a decimal value.
(f)Perimeter of a squarefloatThe perimeter of a square can be a whole number, using float allows for more flexibility (e.g., in case side length is a decimal).
(g)Name of the studentstrNames are sequences of characters.
(h)Address of the studentstrAddresses are text data, which may include letters, numbers, and special characters.