Explain how can you generate random numbers in python?



Explain how can you generate random numbers in python?..

Answer / Amish Kumar

In Python, the random module provides functions for generating random numbers. You can use functions like random(), randint(), uniform(), and seed() to generate different types of random numbers. For example, random() returns a float number between 0.0 and 1.0, while randint(a, b) returns an integer within the range of a and b (inclusive).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you achieve web scraping in python?

1 Answers  


Since switch-case is not used in python – what are the replacements for switch statement in python?

1 Answers  


Describe how multithreading is achieved in python?

1 Answers  


What is multithreading? Give an example?

1 Answers  


How do I run python on windows?

1 Answers  


How to overload constructors or methods in python?

1 Answers  


Is c++ or python better?

1 Answers  


How do I run a py file in python shell?

1 Answers  


Tell me how are arguments passed by value or by reference?

1 Answers  


Explain the role of repr function.

1 Answers  


Why do we need break and continue in python?

1 Answers  


Explain python is one line?

1 Answers  


Categories