Ask Question

Which of the following expressions will produce a valid random integer between the int values m and n inclusive, where m < n?

+4
Answers (1)
  1. 8 March, 00:46
    0
    The solution code is written in Python:

    m = 1

    n = 5

    d = random. randint (m, n)

    Explanation:

    To get a random integer between m and n inclusive, we can make use of Python randint method. It will take two parameters, m and n. By giving two integers as an input (e. g. 1 and 5) to randint, it will generate a random integer between 1 to 5 inclusive.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following expressions will produce a valid random integer between the int values m and n inclusive, where m < n? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers