I think you are on the right track with creating a binary 'on-off' variable in f.
f = LpVariable('f',0,1,cat='Integer')
If I understand correctly, you need B to be > 5 as long as A is > 20, right?
Then what you need is to tweak your code such f is set to 1 as long as A is more than 20.
Since f is binary, you can do this:
prob+= f>= (A-20)/80
prob+= B>= 6*f
In the first line, (A-20)/80 will be negative for values of A from 0 to 19, and will be zero when A is 20. This will ensure that f is zero for these values of A.
When f is zero, the second constraint just implies B has to be at least zero, which is its lower bound anyway.
If, however, A is 21 and above ie A>20, then (A-20)/80 becomes positive, but never greater than 1 (more on this later). This then forces f to be at least 1 whenever A is 21 and above. Since f can only be 1 or 0, f then is set to 1.
This will result in the second constraint forcing B to at least 6 whenever B is 1, which is whenever A is greater than 20. In short, B is more than 5 whenever f is 1, which is whenever A is greater than 20.
Hope this helps! Please let me know if it doesn't work. I've been working on a puLP problem myself, and used this method to write a few of my constraints.
Note:
We divide by 81 to ensure that (A-20)/80 always never bigger than one. for example, if A is 21, then (A-20)/80 evaluates to 1/80. Since A can only be as large as 100, then (A-20)/80 can therefore only ever be as large As (100-20)/80 ie 1. If we changed it to (A-20)/X, where X here is any other value below the largest value of (A-20), then the fraction (A-20)/X can be more than 1. And since f is binary (1 or 0), then the constraint f>= (A-20)/X would mean we would actually be forcing A to be smaller than it would be otherwise.