Q. How can you generate a random integer between 1 and 10?

  • (A) random.randint(1, 10)
  • (B) random.random(1, 10)
  • (C) random.randint(10)
  • (D) random.randomint(1, 10)
πŸ’¬ Discuss
βœ… Correct Answer: (A) random.randint(1, 10)
Explanation: `random.randint(a, b)` returns random integer between a and b inclusive.
Explanation by: Mr. Dubey
`random.randint(a, b)` returns random integer between a and b inclusive.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
88
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
97%
Success Rate