Last active
December 24, 2020 10:28
-
-
Save AliRn76/d4698a41716550d55a108c285f763ed7 to your computer and use it in GitHub Desktop.
matris 3*3
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
import random | |
def jam(): | |
global array | |
sum = 0 | |
for i in range(len(array)): | |
for j in range(len(array)): | |
sum = sum + array[i][j] | |
return sum | |
array = [[0 for i in range(3)] for j in range(3)] | |
for i in range(3): | |
for j in range(3): | |
array[i][j] = random.randint(0,20) | |
# in 2 ta for ziri ro bara visualization gozashtam | |
for i in range(3): | |
for j in range(3): | |
print (array[i][j], end=' ') | |
print () | |
result = jam() | |
print("result: ", result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment