Below you will find pages that utilize the taxonomy term “lesson 9”
June 10, 2024
Learn to Code in 5 Minutes a Day: Lesson 9
Lesson 8 Solution: Roman Numeral III Yesterday’s exercise was to get to roman numeral III. Did you get something like this?
roman.go
func roman(number int) string { if number == 3 { return "III" } if number == 2 { return "II" } return "I" } roman_test.go
package main import ( "testing" ) func TestRoman1(t *testing.T) { result := roman(1) expected := "I" if result != expected { t.Errorf("result was incorrect, got: %v, want: %v.
read more