Write a code to generate independent and identically distributed (i.i.d.) draws from a given distribution X given that we only have access to a random number generator.

Interview question asked to Data Scientists interviewing at Glovo, Bloomberg, Google and others: Write a code to generate independent and identically distributed (i.i.d.) draws from a given distribution X given that we only have access to a random number generator..