Q 21 in graded assignment 1

157 views
Skip to first unread message

Kaushik Deka

unread,
Oct 19, 2020, 3:39:37 PM10/19/20
to Discussion forum for Computational Thinking
Hello CT group,

Is the datatype for serial number of each item bought in the “Shopping Bills” dataset necessarily integer ? Why can it not be string - a sequence of alphanumerics ?

Sincerely,

Kaushik Deka 

Vedansh Gupta

unread,
Oct 19, 2020, 4:38:31 PM10/19/20
to Discussion forum for Computational Thinking
Yes, same doubt. As the serial number of each item like milk, carrot is not printed, it cannot be assumed as integer if serial number is a combination of numbers, letters or alpha numeric characters.

Since, serial number is not specified, i also feel string is a safer data type to choose. 

Had serial number of each item been printed as numbers on card, then integer is correct. Since, nothing is printed, it should be string. Please clarify.

Archita Singh

unread,
Oct 20, 2020, 12:14:07 AM10/20/20
to Discussion forum for Computational Thinking, Vedansh Gupta
I guess the serial numbers are to be taken as 1,2,3,... and hence the integer datatype while the item code which is different from the serial number is a series of alphanumerics and hence the datatype string.

Kaushik Deka

unread,
Oct 20, 2020, 12:58:06 AM10/20/20
to Discussion forum for Computational Thinking, vedan...@gmail.com
What if serial number = item code ?

Kaushik Deka

unread,
Oct 20, 2020, 4:31:09 AM10/20/20
to Discussion forum for Computational Thinking, vedan...@gmail.com

Kaushik Deka

unread,
Oct 21, 2020, 5:38:49 AM10/21/20
to Discussion forum for Computational Thinking, vedan...@gmail.com
Could somebody from the IITM support team comment on this please.
Reply all
Reply to author
Forward
0 new messages