+ 6
Here is the solution using a loop for -> package main import "fmt" //import "strings" func main() { //outputs GO 3 times for i:=1; i<=3; i++ { //fmt.Printline("Go\n") fmt.Println("GO") //fmn.Println("0") } }
6th Jul 2021, 8:46 AM
Alexandra Leshykovich
Alexandra Leshykovich - avatar
+ 1
Show your attempt. This is a code-coach problem.
11th May 2021, 6:32 PM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
0
Hi! About what colleague you are talking?
11th May 2021, 6:28 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
the Answer step by step explained.... pack(age) main ^ Go uses package keyword import "main" ->" fmt" ^ main is not a package, fmt is func mine -> main() { ^ main is default part 1
11th May 2021, 6:49 PM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
0
// outputs GO 3 times fmt.PrintLine -> println("go" -> "Go") ^ ^ println default Change from go to Go (each by three times) fmt.println("go" -> "Go") (// remove comment) fmt.PrintLn -> println("Go") ^ uncapitalize p in println }
11th May 2021, 6:56 PM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
0
Mik S. Read compile errors carefully and apply suggested fix. It's easy. Also review lessons, before do exercises. So... ============ 1. Each Go file begins with package declaration which it belongs to. Use "package" keyword to code that. 2. Import is wrong. You need import "fmt" to can use their functionality. 3. The main package needs a function "main" without args as program entrypoint. 4. When you import a package an implicit variable with last slug as name is available. "fmt" => fmt.Xxxx 5. Golang is case sensitive. Things in capital, are exported variables. You only can use non-exported variables/functions if you are in same package. 6. Also strings to be output are case sensitive. Use "GO" 7. Review available functions in documentation to check existence https://golang.org/pkg/fmt/ https://code.sololearn.com/cnKw1FgmH3gT/?ref=app
14th May 2021, 1:57 PM
David OrdĂĄs
David OrdĂĄs - avatar