+ 1

Assertions

How is the below program works? https://code.sololearn.com/c0tEYC9b6S1k/?ref=app

3rd Nov 2019, 7:20 AM
Preethi Loganathan
Preethi Loganathan - avatar
2 odpowiedzi
+ 1
Since print (1) has no assert statement before it, 1 gets printed. Then check(assert) if 2+2 is equals to 4 or not. If yes then print 2 else go to next statement. And so on ... In the end if any condition doesn't match "you are SOL" gets printed.
3rd Nov 2019, 7:26 AM
Chetali Shah
Chetali Shah - avatar
+ 1
Tq u
3rd Nov 2019, 7:32 AM
Preethi Loganathan
Preethi Loganathan - avatar