On 15 November 2012 01:47, su29090 <span dir="ltr"><<a href="mailto:129km09@gmail.com" target="_blank">129km09@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




I brought a python book and i'm a beginner and I read and tried to do the questions and I still get it wrong.<br>
<br>
How to create a program that reads an uspecified number of integers, that determines how many positive and negative values have been read, and computes the total and average of the input values(not counting zeroes). My program have to end with the input 0 and have to display the average as a floating-point number.<br>




</blockquote><div><br></div><div>Think about the requirements.</div><div>For example, you need here:</div><div>* Some sort of loop to take in an unlimited number of integers</div><div>* Some way to take in integers</div>



<div>
* Some way of stopping when a 0 is entered</div><div>* Some way of finding the total and averages</div><div>* Some way of putting it all together</div><div> </div><div>If you can solve some of these sub-tasks and just need help with others, tell us what you've done and we'll help you work out the rest.</div>




<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Use nested loops that display the following patterns in separate programs:<br>
<br>
1<br>
12<br>
123<br>
1234<br>
12345<br>
123456<br></blockquote><div><br></div><div>What are the patterns here?</div><div>1st: 1 -> 2 -> 3 -> 4 -> ...</div><div>2nd: 1 -> 12 -> 123 -> 1234 -> ...</div><div><br></div><div>How would you do these? How would you combine them?</div>




<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
123456<br>
12345<br>
1234<br>
123<br>
12<br>
1<br></blockquote><div><br></div><div>How would you change the above to do this instead?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




     1<br>
    21<br>
   321<br>
  4321<br>
 54321<br>
654321<br></blockquote><div><br></div><div>How would you change it to do this?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




Write a program that computes the following summation:<br>
<br>
1/ 1+square root of 2 + 1/ 1+square root of 2 + square root of 3 + 1/ 1+square root of 3 + square root of 4...+ 1/ 1+square root of 624 + square root of 625<br></blockquote><div><br></div><div>You've probably written this wrong. You've got:</div>



<div>(1/ 1) + (square root of 2) +  (1/ 1) + (square root of 2) + (square root of 3) + (1/ 1) + (square root of 3) + (square root of 4)... +  (1/ 1) + (square root of 624) + (square root of 625)<br></div><div><br></div><div>



Which you can write as: 1 + root(2) + 1 + root(2) + root(3) + 1 + root(3) + root(4) + ... + 1 + root(624) + root(625)</div><div>As (1/1) is 1. You probably need brackets somewhere. I've never seen any equation like this, so I can't guess at what you really wanted.</div>



<div><br></div><div>Do you know how to find the square root? Just search "square root python" if you do not.</div><div>Then put it in a loop.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
How to  a program to draw a chessboard using range?<br></blockquote><div><br></div><div> I imagine you want to use "loops", where a range is what you loop over.</div><div><br></div><div>O X O X O X O X</div><div>



X O X O X O X O<br></div><div><div>O X O X O X O X</div><div>X O X O X O X O</div></div><div><div>O X O X O X O X</div><div>X O X O X O X O<br></div><div><div>O X O X O X O X</div><div>X O X O X O X O</div></div></div><div>


<br></div><div>It's 8 by 8, so you want to loop 8 times for one dimension and 8 times for the other. How would you use range to do this?</div></div></div>