Can you please elaborate why you use backslash and apostrophe mark
in front and end of data in the following code:
print('The sum of \'data\' is :',total)
Within the print string, from the first ' to the final ', if you wish to include another ' or a set of ', you need to use an ESCAPE character, which is \ (backslash). This is how the output shows The sum of 'data' is: not just The sum of data is:
Same process if you wanted to print Data's sum is: you would have to use 'Data\'s sum is:'
Link above gives same details - from 2:40 in the video.....
Or Page 8 'Introduction to Python - Course Notes' with the video examples.
Hope this helps.