is it possible to have every time you don't include q in the word to have a different input ask like "type a word that actually has q" then to "you keep typing words without q" then to "please a q word is not so hard to type" kind of thing?
Yes, we could definitely modify our program so that it gives different messages depending on how many times the user has entered a word that doesn't include a Q. I'd suggest trying to use an accumulator variable to keep track of the number of user attempts, and then an if/elif statement using that accumulator:
word = input("Give me a word that contains the letter Q: ")
attempts = 1 # initialize number of times user has input a word
while not (("q" in word) or ("Q" in word)):
# this condition is True whenever word does NOT contain q
if attempts == 1:
word = input("Give me a word that ACTUALLY contains Q: ")
elif attempts == 2:
word = input("You keep typing words without Q. Try again: ")
else:
word = input("Please, a q word is not so hard to type: ")
attempts += 1
print("Hey, that word contained a Q! Congrats!")
When do we use boolean flags? / I'd want an example of a boolean flag. / how to update flag in some point?
We'll start with this on Wednesday.