Help me find what this error means

I am using pysynth and I am trying to make it so that you can input a letter and using a second input you can input a length by typing whole/half/quarter/eighth and it will turn that word into a number pysynth can recognize like 1/2/4/8. Here is my code:


generatedSong=[]

while True:
  pickNote=input("Please pick a note or enter '1' if you would like to stop! ")
  if pickNote=='1':
    break
  pickLength=input("Please pick a note length. ")
  if pickLength=="whole":
    pickLength=1
  elif pickLength=="half":
    pickLength==2
  elif pickLength=="quarter":
    pickLength==4
  else:
    pickLength=8
  generatedSong.append((pickNote, pickLength))


pysynth.make_wav(generatedSong, fn='MySong.wav')

Here is the console and the error message:

Key number      Scientific name Frequency (Hz)
         1                   A0          27.50
         2                  A#0          29.14
         3                   B0          30.87
         4                   C1          32.70
         5                  C#1          34.65
         6                   D1          36.71
         7                  D#1          38.89
         8                   E1          41.20
         9                   F1          43.65
        10                  F#1          46.25
        11                   G1          49.00
        12                  G#1          51.91
        13                   A1          55.00
        14                  A#1          58.27
        15                   B1          61.74
        16                   C2          65.41
        17                  C#2          69.30
        18                   D2          73.42
        19                  D#2          77.78
        20                   E2          82.41
        21                   F2          87.31
        22                  F#2          92.50
        23                   G2          98.00
        24                  G#2         103.83
        25                   A2         110.00
        26                  A#2         116.54
        27                   B2         123.47
        28                   C3         130.81
        29                  C#3         138.59
        30                   D3         146.83
        31                  D#3         155.56
        32                   E3         164.81
        33                   F3         174.61
        34                  F#3         185.00
        35                   G3         196.00
        36                  G#3         207.65
        37                   A3         220.00
        38                  A#3         233.08
        39                   B3         246.94
        40                   C4         261.63
        41                  C#4         277.18
        42                   D4         293.66
        43                  D#4         311.13
        44                   E4         329.63
        45                   F4         349.23
        46                  F#4         369.99
        47                   G4         392.00
        48                  G#4         415.30
        49                   A4         440.00
        50                  A#4         466.16
        51                   B4         493.88
        52                   C5         523.25
        53                  C#5         554.37
        54                   D5         587.33
        55                  D#5         622.25
        56                   E5         659.26
        57                   F5         698.46
        58                  F#5         739.99
        59                   G5         783.99
        60                  G#5         830.61
        61                   A5         880.00
        62                  A#5         932.33
        63                   B5         987.77
        64                   C6        1046.50
        65                  C#6        1108.73
        66                   D6        1174.66
        67                  D#6        1244.51
        68                   E6        1318.51
        69                   F6        1396.91
        70                  F#6        1479.98
        71                   G6        1567.98
        72                  G#6        1661.22
        73                   A6        1760.00
        74                  A#6        1864.66
        75                   B6        1975.53
        76                   C7        2093.00
        77                  C#7        2217.46
        78                   D7        2349.32
        79                  D#7        2489.02
        80                   E7        2637.02
        81                   F7        2793.83
        82                  F#7        2959.96
        83                   G7        3135.96
        84                  G#7        3322.44
        85                   A7        3520.00
        86                  A#7        3729.31
        87                   B7        3951.07
        88                   C8        4186.01
Please pick a note or enter '1' if you would like to stop! c
Please pick a note length. half
Please pick a note or enter '1' if you would like to stop! 1
Writing to file TwinkleTwinkleTittleStar.wav
[1/1]
Traceback (most recent call last):
  File "main.py", line 25, in <module>
    pysynth.make_wav(generatedSong, fn='TwinkleTwinkleTittleStar.wav')
  File "/usr/local/lib/python3.6/site-packages/pysynth.py", line 148, in make_wav
    if x[1] < 0:
TypeError: '<' not supported between instances of 'str' and 'int'
python3 exited with code 1...

The error is thrown only when I do not used “whole” as the length. But thats not what I am asking here. Does anyone know what the error means? I don’t want the solution to the problem in my code I want to figure out where it is going wrong by myself, I just want to know what the error means.

This means that one of the values being compared is a string and one an integer, and because of that a < (less than) comparison between them is impossible.

You said you want to figure out the reason by yourself, so I’ll just leave a hint in a spoiler just in case you get stuck: One of the pick variables may be either the input string or a number when generatedSong.append((pickNote, pickLength)) gets called.