(1) a can of coke varies in volume based on different places in the world. 330 ml in europe, 355 ml in north america.
(2) Sweetness of a can of coke varies by country. 10.6g sugar per 100ml in France, 11g sugar per 100ml in USA, 12g sugar per 100ml in Canada.
A canadian can of coke is 355ml and 42g of sugar, per the label printed on it.
A uk can of coke is 330ml and 35g of sugar.
Eg. USA has a 12oz can with 39 grams of sugar. UK has a 330ml can with 35 grams of sugar. (They aren't required to provide more precise accounting and so that 35 or 39 are rounded figures). These are close to the same.
Of course, if one is using 'coke' generically, there are many that have more than 40 grams. A 12oz can of A&W root beer is at 46 grams, as is a 12oz Mountain Dew.
I.e. "4 grams of sugar per 100ml of coke"
Also unit dosage for virtually all consumers is the unfortunately somewhat variable can.
39 g is far more representative of the overwhelmingly likely sugar consumption in the US than any per ml measure, and far more useful when discussing diets.
A can of Coke has 33g of sugar.