Skip to content

Instantly share code, notes, and snippets.

@Vishakha263
Last active May 26, 2019 06:55
Show Gist options
  • Save Vishakha263/f06ac92750fd31acb7bbc410a65d593d to your computer and use it in GitHub Desktop.
Save Vishakha263/f06ac92750fd31acb7bbc410a65d593d to your computer and use it in GitHub Desktop.
break control statement
import random
bottles=['Yellow','Blue','Red','Black']
for chances in range (0,10):
shot_bottle=random.choice(bottles)
print(shot_bottle)
if (shot_bottle == 'Black'):
print ('GAME OVER')
break
@muddlebee
Copy link

import random
shot_bottles=['Yellow','Blue','Red','Black']

for chances in range (0,10):
    bottle=random.choice(shot_bottles)
    print(bottle)
    
    if bottle == 'Black':
        print ('GAME OVER')
        break
       

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment