Created
February 27, 2012 18:24
-
-
Save kastaneda/1925978 to your computer and use it in GitHub Desktop.
Learning Python
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
#!/usr/bin/python | |
# this works as I expect, result is [[1, 2, 3], [4, 5, 6], [7, 8, 9]] | |
q = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] | |
# this works strange, result is [[7, 8, 9], [7, 8, 9], [7, 8, 9]] | |
q = [[0]*3]*3 | |
z = 0 | |
for y in range(3): | |
for x in range(3): | |
z = z+1 | |
q[y][x] = z | |
print q |
А теперь в блоке кода…
print u"Привет, мир!"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Проверка возможности писать кириллицей.