Create a for loop that counts up to one variable by another in lua [closed] - variables

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
This is an assignment I must complete in CSP and I'm completely dumbfounded as to how to do it:
"Get two numbers from the user. The first will be the number to count up to, the second will be the number to count by.
For example, the user gives the numbers "20" and "3"
1
4
7
10
13
16
19
Note: it didn't actually reach 20."

Seems pretty standard
for i = start, finish, increment do
print(i)
end
Is a for loop, so just substitute finish and increment with the numbers and set start to 1

Related

How can I limit some specific numbers and return them with a title? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I have a table in postgresql which contains scores of students and I wanna show scores less than 10 with word 'failed' and more than 10 with the word 'passed'. How can I do that using a query?
As result I want a table with two columns. First scores and second 'passed' or 'failed'.

Need to write where condition consists of 2 groups [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
I want to write where condition in a SQL Server query which has following conditions:
Where paymentmode='Bank' and Status not equal to Paid
payment mode='cash' and sataus not equal to completed
How I can write these 4 condition b
We put the sets of conditions in brackets. In the following either all the conditions in the first parenthesis must be met or all those in the second.
Where
(paymentmode='Bank'
and Status <> 'Paid')
Or
(paymentmode='cash'
and status <> 'completed')

Why put 2 in (test_sums == 2).mean() [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
simulate 1 million tests of three fair coin flips
tests = np.random.randint(2, size=(int(1e6), 3))
sums of all tests
test_sums = tests.sum(axis=1)
proportion of tests that produced exactly one head
(test_sums == 2).mean()
if heads is represented by 0 then any test containing only one heads will contain one 0 and two 1, thus their sum will be exactly 2
more descriptive way of writing the code would be to check every occurrences of head
heads = tests == 0
then sum the occurrences per test
heads_per_test = heads.sum(axis= 1)
and see where total occurrences are exactly 1
(heads_per_test == 1).mean()

Need RegEx to filter dataset according to specific position in string [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Want to filter dataset with SQL query using RegEx to filter entries based on the time (hour) e.g. 19:XX or 09:XX. The hour part of the string would be in position 12 and 13.
Checked a few other questions and articles, but I'm very new to this and can't figure it out. Don't know which SQL database it is, but I work with it on Google BigQuery.Thanks for your help!
Screenshot of data entries
The standard way to access the hour in a date/time is:
where extract(hour from timecol) = 19
Not all databases support extract. All should have something similar.

SQL Image field divided by 2 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Could anyone help me on the below please?
I have a field called F1.Images and I need to divide by 2 ONLY when my other field W1.Plex is Duplex else I need to retain the F1.Images count.
Thanks Satya
Sorted Brad.
Used Case/When logic. Here's the Answer:
Case
WHEN W1.Plex = 'Duplex' then (F1.images / 2)
Else F1.images
End AS Pages