Im enjoying my first crack at MicroPython, feels somehow more robust than C, which I'm almost dangerous with, but after an afternoon goolging today I'm finding it really hard to do a simple thing, I'm sure I'm just not seeing something here, but id be grateful for some help I want my loop below to input move_amnt if i type in either "cw" or "ccw" for direction
My code below works in the wider program, except for the line if direction != ('cw' or 'cww'):
Code: Select all
while True:
direction = input('Move Clockwise, or couter-Clockwise? ')
if direction != ('cw' or 'ccw'):
print ('unrecognised direction')
continue
else:
move_amnt = int(input ('how far? (180° ≈ 1500)? '))
if direction == ('cw'):
move_cw()
elif direction == ('ccw'):
move_ccw()
The "first" option always works fine, but the other option is not considered, and i don't know why, there dosen't seem to be anything that complicated about the syntax for or in MicroPython
I'm sure its obvious to someone, but I'm stumped