This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
bottles=['Yellow','Blue','Red','Black'] | |
lives=4 | |
for chances in range (0,20): | |
shot_bottle=random.choice(bottles) | |
print(shot_bottle) | |
if (shot_bottle == 'Black'): | |
lives -=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shot_bottles=['Yellow','Green','Blue','Red','Black'] | |
level,score=1,0 | |
for bottle in shot_bottles: | |
if bottle != 'Black': | |
score+=1 | |
if score==2: | |
level+=1 | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count=0 | |
stud_marks=[84,31,56,77,22,9,89] | |
for marks in stud_marks: | |
if (marks<32): | |
continue | |
count+=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=0 | |
while i >= 0: | |
i=i+1 | |
if i % 2 == 0: | |
continue | |
print(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=1 | |
while (i<4): | |
if(i==2): | |
i+=1 | |
continue | |
print(i) | |
i+=1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total_pen=int(input()) | |
for pen in range (0,total_pen): | |
if (pen==30): | |
print('box is packed') | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
types = ['broken', 'intact', 'crushed'] | |
collected_shells = 0 | |
for shell in types: | |
if shell=="broken": | |
continue | |
else: | |
collected_shells+=1 | |
print(collected_shells) | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list=[1,2,3,4,1,2,3,4,1,2] | |
for i in list: | |
if (i==4): | |
break | |
print(i) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
star,i=0,1 | |
while i>0: | |
if (star==6): | |
break | |
print('*',end='') | |
star+=1 | |
print('Congratulations') |
OlderNewer