0

Can anyone help me with the quiz 1 of assertions part?

The solution of the problem is 1 though I think it should be 0. There might be some lack of understanding on my part. Please help me understand and corrrect myself.

21st Jun 2020, 9:10 AM
shagun yadav
shagun yadav - avatar
3 odpowiedzi
+ 3
shagun yadav Put your question here to help u
21st Jun 2020, 9:12 AM
Muhammad Galhoum
Muhammad Galhoum - avatar
+ 1
🤔 how we will know for what are you talking about. Please give more info about your question
21st Jun 2020, 10:39 AM
Ayush Kumar
Ayush Kumar - avatar
0
This is how the question starts What is the last number printed? print(0) assert "h" != "w" print(1) assert False ... Firstly 0 is printed. Then it asserts that "h" is NOT equal to "w". This is of course True, so the program continues. Then it prints(1). When it asserts False, this is obviously False, so the error is called and the program (as we see it) ends. This means 1 is the last number printed.
21st Jun 2020, 10:59 AM
Russ
Russ - avatar