Post

Python Coding
Python Coding@clcoding·
What is the output of following Python Code?
Python Coding tweet media
English
144
50
393
85.8K
Samuel Osondu 👑
Samuel Osondu 👑@SamuelOsondu_Py·
@clcoding 20, 15 The given code a variable ‘num’ is assigned the value 20. Then the ‘while loop’ The while loop repeats a block of code as long as a specified condition remain true. Checks to see if the value is ‘greater’ then 10. +
English
3
1
11
2K
Samuel Osondu 👑
Samuel Osondu 👑@SamuelOsondu_Py·
@clcoding If that remains, it will run the block within, which subtracts 5 from tne value on each iteration. Hence, First iteration; 20 is definitely more than 10, so it enters the block prints 20 and subtracts 5 making it 15. Second iteration; similarly, +
English
1
0
1
71
Paylaş