Issue
first image I was having problem when I run this code I raise exception in function then why none is printing
sec image And in this case none is not printing.. pls help
Solution
when a python function does not have a return statement it automatically return None.
In the first image, the print(numcheck(5))
pass the assert but the function return None so it printed None but print(numcheck(-5))
did raise the exception.
In the second image print(numcheck(-5))
raise directly the exception so python did not print anything.
Answered By - Ghassen Sultana Answer Checked By - Robin (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.