0
How to create 1 2 4 7 11 16 22 ...... <=100 pattern in python only using while repetition
pseudocode I created, Begin a=0 b=1 c=a+b While c<=100 : print c a=c b=b+1 Endwhile End
3 odpowiedzi
+ 2
Translate this into code
let number = 1
let addition = 1
repeat while number <= 100
print number, with a space in place of line break at end of line
increment number by addition
increment addition by 1
+ 1
Start the Python for Beginners course, then try to translate the pseudo code to Python.
+ 1
You need to change a = 1 and b = 0
Also, in the while loop you are not incrementing c, therefore add 'a' and 'b' to c before the while loop ends.