Computer Science, asked by poojagalhotra4375, 1 year ago

How to read text file into a list or array with Python?

Answers

Answered by tanishqmishra
0

Read Only ('r') : Open text file for reading. ...

Read and Write ('r+') : Open the file for reading and writing. ...

Write Only ('w') : Open the file for writing. ...

Write and Read ('w+') : Open the file for reading and writing. ...

Append Only ('a') : Open the file for writing.

Answered by PRATHAMABD
0

&lt;body&gt;&lt;!DOCTYPE html&gt;</p><p>&lt;html&gt;</p><p>&lt;body&gt;</p><p></p><p>&lt;canvas id="canvas" width="400" height="400"</p><p>style="background-color:#333"&gt;</p><p>&lt;/canvas&gt;</p><p></p><p>&lt;script&gt;</p><p>var canvas = document.getElementById("canvas");</p><p>var ctx = canvas.getContext("2d");</p><p>var radius = canvas.height / 2;</p><p>ctx.translate(radius, radius);</p><p>radius = radius * 0.90</p><p>setInterval(drawClock, 1000);</p><p></p><p>function drawClock() {I m</p><p>  drawFace(ctx, radius);  grad.addColorStop(1, '#333');</p><p>  ctx.strokeStyle = grad;</p><p>  ctx.lineWidth = radius*0.1;</p><p>  ctx.stroke();</p><p>  ctx.beginPath();</p><p>  ctx.arc(0, 0, radius*0.1, 0, 2*Math.PI);</p><p>  ctx.fillStyle = '#333';</p><p>  ctx.fill();</p><p>}</p><p></p><p>function drawNumbers(ctx, radius) {</p><p>  var ang;</p><p>  var num;</p><p>  ctx.font = radius*0.15 + "px arial";</p><p>  ctx.textBaseline="middle";</p><p>  ctx.textAlign="center";</p><p>  for(num = 1; num &lt; 13; num++){</p><p>    ang = num * Math.PI / 6;</p><p>    ctx.rotate(ang);</p><p>    ctx.translate(0, -radius*0.85);</p><p>    ctx.rotate(-ang);</p><p>    ctx.fillText(num.toString(), 0, 0);</p><p>    ctx.rotate(ang);</p><p>    ctx.translate(0, radius*0.85);</p><p>    ctx.rotate(-ang);</p><p>  }</p><p>

Similar questions