It's best not to compare against an absolute value with floating point in this sort of scenario because your increment may have gone beyond it. Use something like:
if (rotationdegrees >= 360.0):
rotationdegrees -= 360.0
Or alternately:
rotationdegrees = fmod (rotationdegrees + whatever value, 360)
The code you are using is never going to stop rotation because the rotate () function uses the current rotation, therefore, the code that says rotate (0) is doing nothing. If you want absolute rotation, then it is better to use rotation_degrees (or rotation) rather than the rotate () function, eg.
rotationdegrees = fmod (rotationdegrees + 2.0 * delta, 360)