Python Developer Question:

Download Job Interview Questions and Answers PDF

How to generate random numbers in Python?

Python Developer Interview Question
Python Developer Interview Question

Answer:

To generate random numbers in Python, you need to import command as

import random

random.random()

This returns a random floating point number in the range [0,1)

Download Python Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me what is negative index in Python?Suppose ou are having multiple Memcache servers running Python, in which one of the memcacher server fails, and it has your data, will it ever try to get key data from that one failed server?