Created
February 6, 2013 00:53
-
-
Save emerak/4719246 to your computer and use it in GitHub Desktop.
Basic Operators - LearnPython.org
This file contains hidden or 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
x = object() | |
y = object() | |
# change this code | |
x_list = [x] * 10 | |
y_list = [y] * 10 | |
big_list = x_list + y_list | |
print "x_list contains %d objects" % len(x_list) | |
print "y_list contains %d objects" % len(y_list) | |
print "big_list contains %d objects" % len(big_list) | |
# testing code | |
if x_list.count(x) == 10 and y_list.count(y) == 10: | |
print "Almost there..." | |
if big_list.count(x) == 10 and big_list.count(y) == 10: | |
print "Great!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment