Python V Pseudocode (OL - IGCSE CS)
Python V Pseudocode (OL - IGCSE CS)
else: ELSE
/// ///
ENDIF
Python (case-sensitive) Pseudocode
For Loop For Loop
This loop would start from 0 and end at 9 (a total This loop would start from 0 and end at 10
count of 10)
For Loop For Loop
NEXT val
ENDFOR
This loop would start from 2 and end at 9 (range This loop would start from 2 and end at 10
function in Python works till n-1)
For Loop For Loop
NEXT val
ENDFOR
This loop would start from 1, end at 10 and This loop would start from 1, end at 10 and
increment the loop variable var by 2 instead of 1. increment the loop variable var by 2 instead of 1.
Python (case-sensitive) Pseudocode
In order to end the For loop for a condition In order to end the For loop for a condition
(Pseudocode does not have break or continue keywords)
for val in range(10):
x = int(input("Enter a value: ")) DECLARE x AS INTEGER
if(x>=0):
continue REPEAT
else: INPUT(“Enter a value: “), x
break UNTIL(x<0)
OR
ENDWHILE
While loop terminates as soon as you enter a While loop ends after 10 iterations and Repeat
negative value otherwise finishes for 10 iterations Until keeps repeating until user enters a value<0
Python (case-sensitive) Pseudocode
Taking input into the array Taking input into the array