Changes between Version 26 and Version 27 of python
- Timestamp:
- Dec 4, 2011, 10:19:12 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
python
v26 v27 554 554 {{{ 555 555 #!python 556 print "%4.1f %4.1f %4.1f %4.1f %4.1f " % ( p0[2*i], p0[2*i+ ], p1[2*i], p1[2*i+1], q[i] )556 print "%4.1f %4.1f %4.1f %4.1f %4.1f " % ( p0[2*i], p0[2*i+1], p1[2*i], p1[2*i+1], q[i] ) 557 557 }}} 558 558 prve in druge točke elementa ter q. 559 560 Rešitev: 561 {{{ 562 #!python 563 f= open("vaja43.dat", "r") 564 lines = f.readlines() 565 n, div = [eval(s) for s in lines[0].split(" ")] 566 print n,div 567 p0 = [] 568 p1 = [] 569 q = [] 570 for i in range(8): 571 x0,y0,x1,y1,qi=[eval(s) for s in lines[1+i].split(" ")] 572 p0.append(x0) 573 p0.append(y0) 574 p1.append(x1) 575 p1.append(y1) 576 q.append(qi) 577 print "%4.1f %4.1f %4.1f %4.1f %4.1f " % ( p0[2*i], p0[2*i+1], p1[2*i], p1[2*i+1], q[i] ) 578 f.close() 579 }}} 559 580 560 581 == vaja44 ==