Skip to main content
2 of 3
replaced http://stackoverflow.com/ with https://stackoverflow.com/

#Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.