Tuesday, February 25, 2014

Implement random function 7 if you are given with random function 5

__author__ = 'nitin'

""" Implement rand_7() if you are given rand_5() """

import random

def rand_seven():
    result_num=random.randint(1,5) + (random.randint(1,5))%3
    return result_num

print rand_seven()

No comments:

My Profile

My photo
can be reached at 09916017317