Very new to Python and I can't get to understand why the inputs is passing through as TRUE with second condition. I was expecting to print "," instead I'm getting ".":
def define_punctuation(inputs):
text = inputs.split()
if text[len(text) - 1] != '/end' and text[0] == 'how' or text[0] == 'when' or text[0] == 'what' or text[0] == 'why':
text = '?'
print(text)
elif text[0] != 'how' or text[0] != 'when' or text[0] != 'what' or text[0] != 'why' and text[len(text) - 1] == '/end':
text = '.'
print(text)
else:
text = ','
print(text)
define_punctuation('test test test')
elifstatement. text[0] is 'test' which is not equal to 'how', so it prints "."