Advertisement
Guest User

Untitled

a guest
May 24th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. from sys import argv
  2.  
  3. from random import uniform
  4.  
  5. t=24
  6.  
  7. c = {}
  8. for i in range(t):
  9.     c[i] = []
  10.     for j in range(2):
  11.          c[i].append(0)
  12.  
  13. for i in range(t):
  14.      for j in range(2):
  15.         if j==0:
  16.             dg = input('Unesi donju granicu za %d. h:' %(i+1))
  17.             c[i][j]=dg
  18.         else:
  19.             gg = input('Unesi gornju granicu za %d. h:' %(i+1))
  20.             c[i][j]=gg
  21.         print('DG=%0.2f, GG=%0.2f' % (dg,gg))
  22.  
  23. fo = open("Cijena.txt", "wb")
  24. for i in range(t):
  25.     fo.write( "%d=%0.2f, " %(i+1,round(uniform(c[i][0],c[i][1]),2)))
  26.  
  27. # Close opend file
  28. fo.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement