Conditionals¶

1. if-elif-else¶

Fill missing pieces (____) of the following code such that prints make sense.

name = 'John Doe'
if ____:
    print('Name "{}" is more than 20 chars long'.format(name))
    length_description = 'long'
elif ____:
    print('Name "{}" is more than 15 chars long'.format(name))
    length_description = 'semi long'
elif ____:
    print('Name "{}" is more than 10 chars long'.format(name))
    length_description = 'semi long'
elif ____:
    print('Name "{}" is 8, 9 or 10 chars long'.format(name))
    length_description = 'semi short'
else:
    print('Name "{}" is a short name'.format(name))
    length_description = 'short'
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-7be7f0c5639e> in <module>
----> 1 if ____:
      2     print('Name "{}" is more than 20 chars long'.format(name))
      3     length_description = 'long'
      4 elif ____:
      5     print('Name "{}" is more than 15 chars long'.format(name))

NameError: name '____' is not defined
assert length_description == 'semi short'