This is the same story as on Wikipedia.
Theoretically, nofollow links in Medium are worth 0 either in the article or comment except for traffic
But there are good shreds of evidence that sites with links from reputed articles in Medium have gained authority (equivalently to Wikipedia).
Obviously in the content is better than in the comments. Use the classical rule for link building: Comments for profile diversity, content for authority.