28 lines
607 B
Go
28 lines
607 B
Go
package main
|
|
|
|
// ---------------------------------------------------------
|
|
// EXERCISE: Append #3 — Fix the problems
|
|
//
|
|
// Fix the problems in the code below.
|
|
//
|
|
// BONUS
|
|
//
|
|
// Simplify the code.
|
|
//
|
|
// EXPECTED OUTPUT
|
|
//
|
|
// toppings: [black olives green peppers onions extra cheese]
|
|
//
|
|
// ---------------------------------------------------------
|
|
|
|
func main() {
|
|
// toppings := []int{"black olives", "green peppers"}
|
|
|
|
// var pizza [3]string
|
|
// append(pizza, ...toppings)
|
|
// pizza = append(toppings, "onions")
|
|
// toppings = append(pizza, extra cheese)
|
|
|
|
// fmt.Printf("pizza : %s\n", pizza)
|
|
}
|