Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "fmt"
import "sort"
keys := make([]string, 0, len(mymap))
for k := range mymap {
	keys = append(keys, k)

for _, k := range keys {
	x := mymap[k]
	fmt.Println("Key =", k, ", Value =", x)
import std.algorithm;
import std.array;
import std.stdio;
     .sort!((a, b) => a.key < b.key)
     .each!(p => writeln(p.key, " ", p.value));
import Data.Map as Map
mapM_ print (Map.toList mymap)
dict_pairs(D, _, Ps),
forall(member(K-V, Ps),
       format("~w:~w~n", [K, V]))
my_map.sort.each{|k,x| puts "#{k}: #{x}"}
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
SortedMap<K, V> mymap = new TreeMap<>();
for(Map.Entry<K, V> e: mymap.entrySet())
	System.out.println("Key=" + e.getKey() + ", Value=" + e.getValue());
for k in sorted(mymap.keys()):
for (k, x) in mymap {
    println!("({}, {})", k, x);
foreach($mymap as $k => $v) {
    echo 'k:', $k, ' ', 'v:', $v, PHP_EOL;
[...mymap.entries()].sort().map(([_, x]) => console.log(x))