Created
January 27, 2017 01:21
-
-
Save akibmayadav/31b4a6e43b25e1132198739f58b590d0 to your computer and use it in GitHub Desktop.
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
# Ambika Yadav | |
# MAT 594E : Open/ Close Doors | |
doorlist = ["closed"]*100 | |
for i in range(1,101): | |
for j in range(1,101): | |
if (j*i <100): | |
if(doorlist[(j*i)-1]=="closed"): | |
doorlist[(j*i)-1] ="open" ; | |
else : | |
doorlist[(j*i)-1] ="closed"; | |
for i in range(0,len(doorlist)): | |
if (doorlist[i] == "open"): | |
print("Door Number " + str(i+1) + " is " + doorlist[i]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment