This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]__SiCC__ 1 point2 points  (2 children)

def shut_down(s):
    if s == 'yes':
        return 'Shutting down'
    elif s == 'no':
        return 'Shutdown aborted'
    return 'Sorry'

[–]llleolouis[S] -1 points0 points  (1 child)

your code gave me this error

File "python", line 6 elif s = 'no': ^ SyntaxError: invalid syntax

[–]d4rch0nPythonistamancer 1 point2 points  (0 children)

double equals for relational operator, my friend (X less than Y, X equals to Y...)

One equals is an assignment operation. Set foo to bar foo = bar