An exception is an unwanted or unexpected event, which occurs during the execution of a program. In Kotlin, all exception classes are descendants of class Throwable. If exceptions are not handled, then It will throw an exception and will stop the execution of program.
A loop is a programming structure that repeats a sequence of instructions until a specific condition is met. To replace the most common use cases of such loopsKotlin uses the concepts of ranges.