Skip to content

Commit

Permalink
#171 Kotlin Average Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
furkanaskin committed Apr 14, 2020
1 parent 6bc421d commit 29f797d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
[![alt text][InstagramIcon]][Instagram]
[![alt text][TelegramIcon]][Telegram]

### #171 Kotlin Average Usage
![alt text](/screenshots/Average.png)

### #170 View Visiblity Extensions
![alt text](/screenshots/ViewVisiblityExt.png)

Expand Down
7 changes: 7 additions & 0 deletions codes/Average.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
val list = arrayListOf<Double>(2.0, 3.0, 7.0)
var average = 0
list.forEach{
average += it.toInt()
}
println(average/list.size) // 4
println(list.average().toInt()) // 4
Binary file added screenshots/Average.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 29f797d

Please sign in to comment.