Graded Assignment 1, Question No. 20

45 views
Skip to first unread message

Arati Jose

unread,
Oct 21, 2020, 7:22:37 AM10/21/20
to Discussion forum for Computational Thinking
Hi 
The answer of this question which asked about the data type of the position of words in the  "Paragraph Words " dataset is given as integers.
But if we talk about the position of an element in any collection, it is written or said as "first, second, third etc" or "1st, 2nd, 3rd..." 
So shouldn't this be a string data type

Arati Jose

unread,
Nov 6, 2020, 2:30:22 AM11/6/20
to Discussion forum for Computational Thinking, Arati Jose
Hi 
Please look into this question
Thank You

Anand Iyer

unread,
Nov 6, 2020, 11:35:54 PM11/6/20
to Discussion forum for Computational Thinking, aratij...@gmail.com
It's more predictable and much easier to work with numbers than strings, so numbers are preferred in most solutions.

That's the simplest answer.  If you want to go deeper, wait until you start working with strings...

Reply all
Reply to author
Forward
0 new messages