Averting shutdown by chance If the chance is 20%, the shutdown will fail! The chance of shutdown success is 70%.
import random def shutdown(): x = random.randint(1,100) if (x >= 20): print("Succeeded!") return True else: print("Failed!") return False shutdown()