i was on the site pyschools working through the exercises, but i dont understand why it wont accept the code i input. [url]http://www.pyschools.com/quiz/view_question/s4-q2[/url] Create a function generateNumbers(start, end, step) that takes in three numbers as arguments and returns a list of numbers ranging from start to the end number (inclusive)and skipping numbers based on the step specified in the arguments. Note: The function range(x, y, z) can takes in 3 arguments. For example, range(1, 11, 2) will return a list of numbers [1,3,5,7,9]. Examples [CODE] >>> generateNumber(2, 10, 2) [2, 4, 6, 8, 10] >>> generateNumber(10, 10, 1) [10] >>> … +0 hello sir getting error when run the loop and going to last value of row count please help and i can not use the 2nd loop in the place of cells(?????) number how can i use this **Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index** *** What I have tried:*** Dim aa As Integer For Z1 = 0 To DataGridView1.RowCount If Me.DataGridView1.Rows(Z1).Cells(2).Value = True Then aa = 1 Else aa = 0 End If Me.DataGridView1.Rows(Z1).Cells(7).Value = aa If Me.DataGridView1.Rows(Z1).Cells(3).Value = True Then aa = aa & 1 Else aa … +0 Hi, from the result in my "for" loop, have stored four value. How to extract that value to show the value(sprintf) ? Kindly refer to the attached the image file. Thanks Regrads, nazif +0 Reusable Code Snippet Denary number to roman numerals (golang) Use Google's modern Go language (aka. golang) to convert a denary number (base 10) to a roman numeral. Just a good exercise to explore Go's map, slice, sort and for loop features. Note that in Go the **:=** is shorthand for assigning a type (by inference) and a value to a variable. A slice is like an array that can grow, and a map is a key indexed list. Go has only the for loop, but the syntax is very flexible and can accomplish all the usual loop duties. +2 Hello! I have a little problem with a For Loop, this is a For Loop in my script: \$last_id = \$conn->lastInsertId(); for(\$a = \$last_id ; \$a > 0 ; \$a--){ code.... } But it doesn't work because of `(\$a = \$last_id ;`, the variable \$a can't be set to the value of \$last_id, but if set this for example `(\$a = 5 ;` it will work. +0 Hi Champs, Im using VBA for Excel. and Im trying to use the code below to move through records and increment their values by one since they meet a certain criteria Sub promotion() Dim x As Range Dim y As Integer Sheet2.Range("c2").Activate Do While y < 1002 y = ActiveCell.Row Set x = Sheet2.Cells(y, 3) x.Value = x.Value + 1 y = y + 1 ActiveSheet.Cells(y, 3).Activate Loop End Sub Except the records are too many and the process is abit slower, Can anyone show me a better way to implement this. +0 Hey everyone, I'm doing a practice problem and I'm stuck. The question is "Given an array a of n numbers (say doubles), consider the problem of computing the average of the first i numbers, for i ranging from 0 to n-1. That is, compute the array b of length n, where b[i] = a[0] + a[1] ....+ a[i]/(i + 1) for 0 <= i < n: Write a Java program to solve this problem. Your program can generate its own array, for example a[i] = i + 1. See how large an array you can process in less than 5 … +0 #include #include struct Book { char bname[20]; int pages; char author[20]; float price; }b1[3]; void main() { struct Book b1[3]={ {"BOOK1",700,"ypk",12.98}, {"BOOK2",500,"aak",350.00}, {"BOOk3",120,"HST",450} }; for(int i=0;i>3;i++) printf("%d\n",b1[i]); getch(); } iwant output book1 700 ypk 12.98 book2 500 aak 350.00 book3 120 hst 450. +0 Hi all , I have a set-interval function inside a for loop and when inside the set-interval function if it meets a criteria give an alert and clear the interval. Below is my code but its not working can anyone tell what the mistake here. var timeCheck = 0; function matchTime() { for (var i=0;i>> generateNumber(1) [0, 1] >>> generateNumber(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> generateNumber(0) [0] [/CODE] i dont know how to do this. i tried; [CODE] def num(num): for x in range(num): lis = [] lis.append(x) y = x + 1 lis.append(y) return lis [/CODE] but it return the following; [CODE] num(10) [0, 1] … +0 I am having hard time understanding what the problem is with my code here. Basically I have a map that contains Key objects as the key, and Block* as the value. The point of this for loop is to print out the values that the key contains on to the console in the form of a game board. However it is only printing one role, in a infinite loop. the variable r never gets incremented for some reason. if you guys could help that would be great. Thanks in advance! for (int r=0; r 50 Then RaiseEvent start() End If ProgressBar1.Maximum = num Catch ex As Exception Continue For //Continue Loop End Try Next [/CODE] I want to skip the files which i dont have access to. But my error is occuring before the try hence i am not able to continue the loop. Please advice on how should … +0 Hello, I was hoping that someone can help me with this. I have this linking list working, but I have one problem, when I click on the link it shows up with the link like this winner.php?service=1&&year=2010 and honorable.php?service=1&&year=2010&award=1 this is for all years not just 2010, and what I need it to do is show winner.php?service=AM&&year=2010 and honorable.php?service=AM&&year=2010&award=Notables I have looked in my db, and the values are correct, so I know that is not the issue. [CODE]
'2000') { ?>
• using namespace std; int main() { int startNum; int nextNum; cout<<"Please Input a number " <> startNum; for(startNum=0; startNum + nextNum<=5; nextNum++) { cout<< startNum+nextNum+nextNum+nextNum+nextNum<< " is the sum of all numbers " <

The End.