Update abscd.py

added condition