Page 1 of 1

[Solved] Meaning of an apostrophe before a number

PostPosted: Thu Oct 25, 2018 4:39 am
by Pedroski55
I am using python to get answers from emails and assign a score to the student. To my surprise, 2017 class 1 and 2 all had zero, whereas classes 3 & 4 has their respective scores.

Checking the start table, I found that, for classes 3 & 4, all the student numbers begin with an apostrophe, like: '1725010301 (Please see the screenshot)
All the student numbers for classes 1 & 2 did not have an apostrophe and no score was inserted in the column next to their number.

I read the email answers into a python style dictionary, studentsScores, then write that to the scores table. The key for each entry is the student number and the value is the score, like {'1725010301', 26, '1725010302', 26, and so on}

When I did

for key in studentsScores.keys():
print(key)

I see no apostrophes.

What is the function of this apostrophe?

I went through my table and inserted an apostrophe before each student number which did not have one, then all the scores were inserted correctly.

Re: the meaning of an apostrophe before a number

PostPosted: Thu Oct 25, 2018 5:59 am
by FJCC
The apostrophe is an indicator that the cell content is text, despite looking like a number. The apostrophe is not part of the cell content, it only appears in the formula bar. If you need the content of column A to be text, I suggest you format it as text before entering any data.

Re: the meaning of an apostrophe before a number

PostPosted: Thu Oct 25, 2018 6:45 am
by Pedroski55
Thank you very much, that cleared that up! It is good because the dictionary key is also text, read from a text file!