Post

Coding Computing Coach
Coding Computing Coach@CodingComputing·
Python question Can you get through this if-conditions drill?
Coding Computing Coach tweet media
English
7
1
17
1.8K
Lucas Garth
Lucas Garth@lucasgarth·
@CodingComputing Doesn't matter if 1 is True, line 12 statement changes value to 4 anyway
English
1
0
1
53
Prem Prakash
Prem Prakash@4EverPrem·
@CodingComputing 2. Although num is assigned value 1 in line 1, we are checking for truthy value in line2 (if num:). All non-zero integers are True so num is assigned 2 in first if condition & same is printed.
English
2
0
1
95
Partager