Kodewick
Start learning →
Basic←→0 / 70

Train ticket

#009BasicOutput3 min

A train ticket shows where from, where to, how long and how much. Use one fmt.Printf to show Leeds to York: 25 min, 8.40, the four values coming from from, to, mins and fare (the fare with two decimal places).

Should show
Leeds to York: 25 min, 8.40
main.go
package main

import "fmt"

func main() {
	from := "Leeds"
	to := "York"
	mins := 25
	fare := 8.4
	// your code here: one fmt.Printf for the whole line, then a newline
}
Ctrl + Enter runs too
Result

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