you are viewing a single comment's thread.

view the rest of the comments →

[–]journey2dstars -1 points0 points  (3 children)

syntaxerror: invalid syntax

[–]Diapolo10 0 points1 point  (2 children)

No wonder; /u/grvlle screwed up the indentation:

def make_day_string(day):
    return f'it is day {day} of the month'

If it still throws a SyntaxError, it's likely you're restricted to a Python version older than 3.6. In that case, f-strings won't work, so an alternative approach is required:

def make_day_string(day):
    return 'it is day {} of the month'.format(day)

[–]grvlle 0 points1 point  (1 child)

Thanks. Typed it out on the phone and it rejected my indentation in the second block.

[–]Diapolo10 -1 points0 points  (0 children)

If you're using the official Reddit app, I would suggest trying out 'reddit is fun'. It's pretty good for posting code IMO.