Monday 20 September 2021

Python: Generate random integer

‘random.randint(min_value, max_value)’ generate a random integer including both min_value and max_value.

 

random_int.py

import random

print(random.randint(10, 100))
print(random.randint(10, 100))
print(random.randint(10, 100))

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment