Add DocTests to diffie.py
diff --git a/ciphers/diffie.py b/ciphers/diffie.py
index 4ff90be009c1..1e1e868999b6 100644
--- a/ciphers/diffie.py
+++ b/ciphers/diffie.py
@@ -1,11 +1,28 @@
 from __future__ import annotations
 
 
-def find_primitive(n: int) -> int | None:
-    for r in range(1, n):
+def find_primitive(modulus: int) -> int | None:
+    """
+    Find a primitive root modulo modulus, if one exists.
+
+    Args:
+        modulus : The modulus for which to find a primitive root.
+
+    Returns:
+        The primitive root if one exists, or None if there is none.
+
+    Examples:
+    >>> find_primitive(7)  # Modulo 7 has primitive root 3
+    3
+    >>> find_primitive(11)  # Modulo 11 has primitive root 2
+    2
+    >>> find_primitive(8) == None # Modulo 8 has no primitive root
+    True
+    """
+    for r in range(1, modulus):
         li = []
-        for x in range(n - 1):
-            val = pow(r, x, n)
+        for x in range(modulus - 1):
+            val = pow(r, x, modulus)
             if val in li:
                 break
             li.append(val)
@@ -15,18 +32,22 @@ def find_primitive(n: int) -> int | None:
 
 
 if __name__ == "__main__":
-    q = int(input("Enter a prime number q: "))
-    a = find_primitive(q)
-    if a is None:
-        print(f"Cannot find the primitive for the value: {a!r}")
+    import doctest
+
+    doctest.testmod()
+
+    prime = int(input("Enter a prime number q: "))
+    primitive_root = find_primitive(prime)
+    if primitive_root is None:
+        print(f"Cannot find the primitive for the value: {primitive_root!r}")
     else:
         a_private = int(input("Enter private key of A: "))
-        a_public = pow(a, a_private, q)
+        a_public = pow(primitive_root, a_private, prime)
         b_private = int(input("Enter private key of B: "))
-        b_public = pow(a, b_private, q)
+        b_public = pow(primitive_root, b_private, prime)
 
-        a_secret = pow(b_public, a_private, q)
-        b_secret = pow(a_public, b_private, q)
+        a_secret = pow(b_public, a_private, prime)
+        b_secret = pow(a_public, b_private, prime)
 
         print("The key value generated by A is: ", a_secret)
         print("The key value generated by B is: ", b_secret)

### Describe your change:
This PR adds DocTests to the functions in diffie.py to increase its codecoverage from 0% to 46%.
Tested this change locally and can verify that they are passing.

Ref #9943 

* [ ] Add an algorithm?
* [ ] Fix a bug or typo in an existing algorithm?
* [ ] Documentation change?

### Checklist:
* [X] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md).
* [X] This pull request is all my own work -- I have not plagiarized.
* [X] I know that pull requests will not be merged if they fail the automated tests.
* [X] This PR only changes one algorithm file.  To ease review, please open separate PRs for separate algorithms.
* [X] All new Python files are placed inside an existing directory.
* [X] All filenames are in all lowercase characters with no spaces or dashes.
* [X] All functions and variable names follow Python naming conventions.
* [X] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
* [X] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
* [X] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
* [X] If this pull request resolves one or more open issues then the description above includes the issue number(s) with a [closing keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue): "Fixes #ISSUE-NUMBER".
