Q. 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:-

(a) Number of months in a year:- int (integer) because number of months always integer.
(b) Resident of Delhi or not: - bool (Boolean) because it contains Answer yes or no it means True or False.
(c) Mobile number: - int (integer) because mobile number always in integer form.
(d) Pocket money: - float or int because pocket money is different for different persons.
(e) Volume of a sphere: - float because volume may be in decimal.
(f) Perimeter of a square: - float because perimeter may be in decimal.
(g) Name of the student: - str (string) because name is the collections of characters.
(h) Address of the student: - str (string) because address is the collections of characters.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post