Available under Creative Commons-NonCommercial-ShareAlike 4.0 International License.
If you have a return statement with a complex expression, you don’t have a chance to print the return value before returning. Again, you can use a temporary variable. For example, instead of:
return self.hands[i].removeMatches()
you could write:
count = self.hands[i].removeMatches()return count
Now you have the opportunity to display the value of count before returning.
- 瀏覽次數:1619