Kodewick
Start learning →
Starter←→0 / 70

Birthday candles

#018StarterLoops3 min

A birthday cake gets one candle per year, and each candle is an "i". Write Candles(age) to return the cake's candles as a string: age 3 gives "iii", age 0 gives the empty string "".

Examples
Candles(3)→'iii'
Candles(0)→''
The functionfunc Candles(age int) string
main.go
package main

func Candles(age int) string {
	cake := ""
	// your code here: for i := 0; i < age; i++, adding one "i" to cake each time
	return cake
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.