__version__ = '0.2.0'


import random
import string

__version__ = '0.2.0'


def random_name(prefix, N):
    """Creates a name with random characters.

    Returns a new string created from an input prefix appended with a set of
    random characters. The number of random characters appended to
    the prefix string is defined by the N parameter. For example,

        random_name('test_', 6) might return "test_FR3N5Y"

    :param string prefix: String to append randoms characters.
    :param int N: Number of random characters to append.
    """
    return prefix + ''.join(
        random.SystemRandom().choice(
            string.ascii_uppercase + string.digits) for _ in range(N))

Add function to create name strings with random characters
Add function to create name strings with random characters

Issues:
Fixes #48

Problem: Need a function that will generate names with random chars.

Analysis: Added new function, random_name().

Tests: test_solution.py

+ 
+ import random
+ import string
+ 
  __version__ = '0.2.0'
  
+ 
+ def random_name(prefix, N):
+     """Creates a name with random characters.
+ 
+     Returns a new string created from an input prefix appended with a set of
+     random characters. The number of random characters appended to
+     the prefix string is defined by the N parameter. For example,
+ 
+         random_name('test_', 6) might return "test_FR3N5Y"
+ 
+     :param string prefix: String to append randoms characters.
+     :param int N: Number of random characters to append.
+     """
+     return prefix + ''.join(
+         random.SystemRandom().choice(
+             string.ascii_uppercase + string.digits) for _ in range(N))
+ 
Add function to create name strings with random characters
## Code Before:
__version__ = '0.2.0'

## Instruction:
Add function to create name strings with random characters
## Code After:

import random
import string

__version__ = '0.2.0'


def random_name(prefix, N):
    """Creates a name with random characters.

    Returns a new string created from an input prefix appended with a set of
    random characters. The number of random characters appended to
    the prefix string is defined by the N parameter. For example,

        random_name('test_', 6) might return "test_FR3N5Y"

    :param string prefix: String to append randoms characters.
    :param int N: Number of random characters to append.
    """
    return prefix + ''.join(
        random.SystemRandom().choice(
            string.ascii_uppercase + string.digits) for _ in range(N))
