Second Choice
[Back] <- - + - -> [Next]
The obvious next step is to handle 'b' in the same way as 'a'.
# previous code
if option == 'a': ### You can copy these two lines ...
print 'You selected "a"'
if option == 'b': ### ... and paste them here.
print 'You selected "b"' ### But be sure to change both a's to b's
Running the code produces this output:
a AAA
b BBB
c CCC
Enter your choice: b
You selected "b"
The menu now responds
to either 'a' or 'b'.
If the first test recognises an 'a' has been entered there is no point in more testing.
This works but the next page shows a better way to achieve the same result.