Write a generator in python which returns a random number between 0 and a million


Topic: Write a generator in python which returns a random number between 0 and a million

Solution

import random
def yield_a_number():
    yield random.randint(0, 1000000)



List all Python Programs