You have a list of students' grades from your class. Each student has two grades. Return a list made up of lists of each student's grades. Possibly, the last student has only one grade. You must take that into account to produce the result.
Retrieve collection parts
List of students' grades
Report a typo
Sample Input 1:
5.5 4.6 3.0 2.5 10.0 9.9 8.75Sample Output 1:
[[5.5, 4.6], [3.0, 2.5], [10.0, 9.9], [8.75]]Write a program in Kotlin
fun main() {
val list = readln().split(" ")
// write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.