add: numbers and strings exercises
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE: ToLowercase
|
||||
//
|
||||
// 1. Look at the documentation of strings package
|
||||
// 2. Find a function that changes the letters into lowercase
|
||||
// 3. Get a value from the command-line
|
||||
// 4. Print the given value in lowercase letters
|
||||
//
|
||||
// HINT
|
||||
// Check out the strings package from Go online documentation.
|
||||
// You will find the lowercase function there.
|
||||
//
|
||||
// INPUT
|
||||
// "SHEPARD"
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// shepard
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(strings.ToLower(os.Args[1]))
|
||||
}
|
Reference in New Issue
Block a user