Loop - Printing ASCII

Part of Golang Mastery course

~15 min read
Interactive
Hands-on
Beginner-friendly

We previously learned how to print the different characters of a string with format printing. Refer to the docmentation for a refresher on the fmt package.

Loop through the numbers 33 through 122, and print them out as numbers and text strings.

Hint: Refer to the ASCII coding scheme to see the decimal and glyph representations.

example.go
package main
 
import (
string">"fmt"
)
 
func main() {
for i := 33; i < 122; i++ {
fmt.Printf(string">"%v\t%#U\n", i, i)
}
}
 

playground

Your Progress

18 of 103 modules
17%
Started17% Complete
Previous
SpaceComplete
Next