General Python practice

Deryck Chan 2017-11-02 onwards

Python input detection

  • Jupyter consoles can use input!
  • Text comparison is exact (case sensitive, space sensitive), and the textbox doesn't add extra spacebar
a = input()
if a == 'y' or a == 'yes':
    print('yay')
elif a == 'n' or a == 'no':
    print('nay')
else:
    print('boleh!')
n
nay