After a quite a long and challenging journey, we finally finish the training on Intermediate level book 1 to book 8.
What a relieve huh ?
Along the training, we have go through concept or theory related to Euler Path, Counting, Shortest Path Distance, Gauss Theorem, Tricks in calculation, Logical Thinking Skills, Speed, Marvels of Triangle and etc. Sorry that I could not list down all one by one.
Please refer to the attachment below for revision exercise (answer provided).
Revision Intermediate level Book 1 - 8
I also do provide the python code to solve question 28 - How many times a digits appear in a range of number. If you may use the code to check your answer.
Check the number of occurence of a digit in a range of number
Saturday, April 6, 2019
Friday, April 5, 2019
Loops
What is loops ?
What loops do ?
Please do imagine you need go bicycle for 7 days.
There is a loop of 7 iterations, and your statement / activity should be cycling.
Keep it simple.
Loop help us to do job repeatedly in one block of codes.
There are several types of loops. For instance, there are for loop, while loop, do while loop and etc.
The basic / simple loop should be for loop.
You may ask your program to do the loop for how many times using "for" keywords.
Example : you may print number 0 to 4 using the statement below
for ind in range(5) :
print (ind)
On the other hand, a while loop will execute the block of codes / statement while / when some condition is fulfilled.
Example : the while loop print "It is true" as long as the condition is true.
Please be reminded that the condition must be true initially, else the while loop will not be executed.
Please be aware that u must have stopping criteria : assign the condition to false in the while loop.
Else you will be having an infinity loop and hit runtime error. (since you never tell the program when should it stops)
condition is true initially
while condition is true :
print("It is true")
if something happend :
condition is false
Please do refer to the link below for further details:
Loop
What loops do ?
Please do imagine you need go bicycle for 7 days.
There is a loop of 7 iterations, and your statement / activity should be cycling.
Keep it simple.
Loop help us to do job repeatedly in one block of codes.
There are several types of loops. For instance, there are for loop, while loop, do while loop and etc.
The basic / simple loop should be for loop.
You may ask your program to do the loop for how many times using "for" keywords.
Example : you may print number 0 to 4 using the statement below
for ind in range(5) :
print (ind)
On the other hand, a while loop will execute the block of codes / statement while / when some condition is fulfilled.
Example : the while loop print "It is true" as long as the condition is true.
Please be reminded that the condition must be true initially, else the while loop will not be executed.
Please be aware that u must have stopping criteria : assign the condition to false in the while loop.
Else you will be having an infinity loop and hit runtime error. (since you never tell the program when should it stops)
condition is true initially
while condition is true :
print("It is true")
if something happend :
condition is false
Please do refer to the link below for further details:
Loop
Subscribe to:
Posts (Atom)
Superior of partial fraction
What is complex fraction? Complex fraction is a fraction whereby its numerator or denominator or both consists of fractions. Partial frac...
-
What is fraction? Imagining you have one whole cake and you need to share the cake among you and your friends. Here come the problems, t...
-
This is a question that challenge your understand skill and programming skill. The Tremendous Tak-Tak Tree Output File: taktakout.txt T...
-
After a quite a long and challenging journey, we finally finish the training on Intermediate level book 1 to book 8. What a relieve huh ? ...