cs50/src6/1/agree2.py

13 lines
258 B
Python

# Logical operators, using lists
from cs50 import get_string
# Prompt user to agree
s = get_string("Do you agree? ").lower()
# Check whether agreed
if s.lower() in ["y", "yes"]:
print("Agreed.")
elif s.lower() in ["n", "no"]:
print("Not agreed.")