gosha gosha

Generation

generate functionSun, 12 Feb 2023

Cancel shutdown by chance If the chance is 20%, the shutdown will fail! The chance of shutdown success is 70%.

import random def cancel_shutdown(): chance = random.randint(1,10) if chance == 1: print("Shutdown failed") else: print("Shutdown successful") cancel_shutdown()

Questions about programming?Chat with your personal AI assistant