Post

Python Coding
Python Coding@clcoding·
What is the output of following Python Code?
Python Coding tweet media
English
144
50
393
85.8K
Kode Gurukul
Kode Gurukul@kodegurukul·
Answer is 20 15: While will iterate two time: 1⃣. num = 20 num > 10 = True num = num -5 = 15 2⃣. num = 15 num > 10 = True num = num -5 = 10 3⃣. num = 10 num > 10 = False Will not execute anything.
Kode Gurukul tweet media
English
1
3
37
2.7K
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
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@clcoding Answer: 20 15 (on separate lines) Solution: Quick recap, a `while` loop's body is repeatedly executed until the condition is condition remains truthy. Here num = 20 assigns the value 20 to `num`. while num > 10: ... This loop will execute as long as num>10 +
English
1
1
8
1.2K
Muhammad Hunain
Muhammad Hunain@Hunain_5698·
@clcoding Check 20>10, yes Print 20 Then, 20-5=15 Now, 15>10, yes Print 15 Then, 15-10=10 Now, 10>10, No End the loop So, the output will be 20 15
English
0
0
3
755
Karan
Karan@iamkarank5·
@clcoding Output:- 20 15 First 20 will be printed then -5 from that so 15 will be printed
English
0
0
2
674
Ni_
Ni_@nikkitapandey1·
@clcoding The correct ans to this snippet is 20 15
English
0
0
1
36
مشاركة