Skip to main content

Command Palette

Search for a command to run...

Loop - Printing ASCII

Updated
1 min readView as Markdown
Loop - Printing ASCII
S
DevRel at StackGen | Formerly at Deepfence ,Tenable , Accurics | AWS Community Builder also Docker Community Award Winner at Dockercon2020 | CyberSecurity Innovator of Year 2023 award by Bsides Bangalore | Docker/HashiCorp Meetup Organiser Bangalore & Co-Author of Learn Lightweight Kubernetes with k3s (2019) , Packt Publication & also run Non Profit CloudNativeFolks / CloudSecCorner Community To Empower Free Education reach out me twitterhttps://twitter.com/sangamtwts or just follow on GitHub -> https://github.com/sangam14 for Valuable Resources

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.

package main

import (
    "fmt"
)

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

playground

10 views

GopherLabs

Part 1 of 50

Ultimate Series of Blogs for All Golang Developer

More from this blog

C

CloudNativeFolks Community

140 posts

CloudNativeFolks is non profit community that empower and educate about cloud native technology !