Question: I am trying to create a procedure that has a user input a non-empty string and then returns a random letter from the input in a substring of length one.

i.e. 

```
(pick-at-random "word")

~"w"

(pick-at-random "word")

~"r"

```

So far I've got:

```
    (define pick-at-random
      (lambda (s)
        (substring s (random(string-length s)) ())))

```

This gives me the position of the letter I want to display and I feel like where the () is, I should have some variable representing the start value of the substring and then add one to it. However, I don't know how to do this. Simply put, I am asking how I can limit the substring to length one while using the random function in the start value.

Answer: 
You may use `let` to bind the random number to a variable.

```
(define pick-at-random
  (lambda (s)
    (let ((index (random (string-length s))))
      (substring s index (+ index 1)))))

```
Here's an alternative answer without using `substring`, in this way you don't need to save the index in a `let` binding. It's a more functional (and hence, idiomatic) solution to the problem:

```
(define (pick-at-random s)          ; read the following lines from bottom to top
  (string                           ; convert single character to string
    (string-ref s                   ; access character in string, given an index
      (random (string-length s))))) ; generate a random valid index in the string

(pick-at-random "word")
> "d"   ; random result

```

The previous procedure generates a random valid index and then picks the character in that position within the string. As the last step, it turns back the single character into a string of length one.