Bug | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Bug

package main import "fmt" func main() { fmt.Println("Go /n Go /n GO") } How do I print Go vertically ? Go Go Go Someone help me out ?

1st Oct 2021, 8:03 AM
Ejeh Wayne
Ejeh Wayne - avatar
3 Answers
+ 1
package main import "fmt" func main() { fmt.Println("Go Go GO") fmt.Println("Go\nGo\nGo") }
1st Oct 2021, 8:11 AM
SAN
SAN - avatar
+ 3
You should use back slashes for new lines like : "\n" Also don't add spaces after new line, or your text will be shifted. Heres a fixed version of your code: https://code.sololearn.com/cqWu2Q4dUILw/?ref=app
1st Oct 2021, 8:12 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
Aleksei Radchenkov Thanks alot
1st Oct 2021, 8:31 AM
Ejeh Wayne
Ejeh Wayne - avatar