SHARE
TWEET

Untitled

a guest Dec 10th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. a=[[random.randint(-10,10) for i in range(4)] for j in range(4)]
  3. for i in range(4):
  4.     for j in range(4):
  5.         print('%4d'%a[i][j], end=' ')
  6.     print()
  7.    
  8. print()
  9.  
  10. for i in range(4):
  11.     s=0
  12.     for j in range(4):
  13.         if a[i][j]==0:
  14.             a[0], a[i]=a[i], a[0]
  15.             s=1
  16.             break
  17.     if s==1:
  18.         break
  19.        
  20. for i in range(4):
  21.     for j in range(4):
  22.         print('%4d'%a[i][j], end=' ')
  23.     print()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top