This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tagastab_listi(): | |
return [42, 57] | |
# tagastusväärtus sisaldab nüüd funktsiooni tagastatud väärtust (listi) | |
# Sellega võib ükskõik mida teha | |
tagastusväärtus = tagastab_listi() | |
# Väljasta tagastatud väärtus lihtsalt listina | |
print(tagastusväärtus) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.PrintWriter | |
import java.io.StringWriter | |
// Extension property on Exception | |
val Exception.stackTraceString: String | |
get() { | |
val stringWriter = StringWriter() | |
this.printStackTrace(PrintWriter(stringWriter)) | |
return stringWriter.toString() | |
} |