Using User Input to control parameters in a Random number Generator
Question: I am attempting to write a program that generates random numbers, asks how big
you want it, between 1-4 for example, then I want it to ask how many numbers
you want and finally ask you if you want to run it again. I am attempting to
grasp the concepts of recursion and type casting, just trying to learn the
concepts of Object Orientated Design with Python. I tried to glean from what I
have read so far on the Learn Python Hard Way site.

    
    
    from random import randint
    def random_with_N_digits(n):
        range_start = 10**(n-1)
        range_end = (10**n)-1
        return randint(range_start, range_end)
    
    # Here I am attempting to define the variables I need to convert keyboard input to int
    
    size = raw_input()
    intsize = # unsure of how to define this variable
    intsize = int(size)
    
    print "How many Digits?",
    size = raw_input()
    
    print "How many Times?".
    times = raw_input()
    
    # I want to construct a method here that sends my size input to random_with_N_digits(n)
    # I need a method that runs the random_with_N_digits according to the input.
    # while True:
    reply = input('Enter text:')
    if reply == 'stop':
        break
        if reply = times # not sure what to put here 
            print( def random_with_N_digits)
        else:
           # I want to tell the my method to run as many as much as 'times' is equal to
    
    
    print "Again?"
    answerMe = raw_input()
    
    # here I want to have a if answerMe = Enter run the method again
    
    
    print random_with_N_digits()
    


Answer: try this code

    
    
    from random import randint
    def random_with_N_digits(n):
        s = int(raw_input("starting from.. "))
        e = int(raw_input("upto... "))
        l = ""
        for i in range(0,n):
            l= l +str( randint(s,e))
        print int(l)
        again = raw_input("print again?")
        if again == "yes":
            how_many =int(raw_input("how many digits?")) 
            random_with_N_digits(how_many)
    
    how_many =int(raw_input("how many digits?")) 
    random_with_N_digits(how_many)
    

