import randomdef has_questionmark(qus): wordlist = qus.split() last_word = wordlist[-1] split_last_word = list(last_word) if '?' in split_last_word: return Truedef has_special_words(qus): wordlist = qus.split() first_word = wordlist first_word = first_word.lower() special_words = ['what', 'where', 'when', 'how', 'why', 'are','do','did'] if first_word in special_words: return True def is_a_yn_question(qus): wordlist = qus.split() first_word = wordlist
This code is to find out the 3-digit numbers that have their digits add up to 9. The problem was originated from the “Problem of the week” from the university of Waterloo. The original question is stated here: https://www.cemc.uwaterloo.ca/resources/potw/2019-20/English/POTWD-19-NA-02-P.pdf The digit positive integer is the sum of all of its digits.