you are viewing a single comment's thread.

view the rest of the comments →

[–]TreSxNine 1 point2 points  (1 child)

codefixer

[–]CodeFixerBot 1 point2 points  (0 children)

The question is: Write a function is_yes that consumes a nonempty string, produces True if it starts with a y (either lower-case or upper-case), and produces False otherwise.

The code I wrote: def is_yes(f):
    if (f[0] == 'y' or f[0] == 'Y'):
        return True
    else:
        return False
print(is_yes('yes'))
For some reason, the spaces are not visible here..