main.py 1 import random 2 3 random.randint(1,10) 4 5- def rand_num(lo,hi,need): 6 pass 8 - for num in rand_num(5,10,5): print(num) 9 Output should be like: 6 10 8 8 7 ...Program finished with exit...


Python Program


Problem: Using the yield keyword, create a number generator that display "need" random numbers from a specific range of number that are specified. Use random library


Instruction: Complete the program below



main.py<br>1 import random<br>2<br>3 random.randint(1,10)<br>4<br>5- def rand_num(lo,hi,need):<br>6<br>pass<br>8 - for num in rand_num(5,10,5):<br>print(num)<br>9<br>Output should be like:<br>6<br>10<br>8<br>8<br>7<br>...Program finished with exit code 0<br>Press ENTER to exit console.<br>

Extracted text: main.py 1 import random 2 3 random.randint(1,10) 4 5- def rand_num(lo,hi,need): 6 pass 8 - for num in rand_num(5,10,5): print(num) 9 Output should be like: 6 10 8 8 7 ...Program finished with exit code 0 Press ENTER to exit console.

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here