The [Linear Congruential Generator (LCG)](https://en.wikipedia.org/wiki/Linear_congruential_generator) is one of the oldest pseudo random number generator functions.

The algorithm is as follows:

## Xn+1=(aXn + c) mod m
where:
* `a`/`A` is the multiplier (we'll be using `2`)
* `c`/`C` is the increment (we'll be using `3`)
* `m`/`M` is the modulus (we'll be using `10`)

X0 is the seed.

# Your task

Define a method `random`/`Random` in the class `LCG` that provides the next random number based on a seed. You never return the initial seed value.

Similar to [random](https://docs.python.org/3/library/random.html#random.random) return the result as a floating point number in the range `[0.0, 1.0)`

# Example

```python
# initialize the generator with seed = 5
LCG(5)

# first random number (seed = 5)
LCG.random() = 0.3      # (2 * 5 + 3) mod 10 = 3 --> return 0.3

# next random number (seed = 3)
LCG.random() = 0.9      # (2 * 3 + 3) mod 10 = 9 --> return 0.9

# next random number (seed = 9)
LCG.random() = 0.1

# next random number (seed = 1)
LCG.random() = 0.5
```

Source: codewars | Difficulty: EASY

Starter code: def __init__(self, seed):
	

Solutions:
class LCG(object):

	def __init__(self, x):
		self._seed = x

	def random(self):
		self._seed = (2 * self._seed + 3) % 10
		return self._seed / 10


class LCG(object):
	a = 2
	c = 3
	m = 10

	def __init__(self, seed):
		self.seed = seed
		self.x = self.seed

	def g(self):
		while True:
			self.x = (self.a * self.x + self.c) % self.m
			yield self.x

	def random(self):
		return next(self.g()) / 10


class LCG(object):
	a = 2
	c = 3
	m = 10

	def __init__(self, seed):
		self.x_n = seed

	def random(self):
		self.x_n = (self.a * self.x_n + self.c) % self.m
		return self.x_n / 10


class LCG:
	a = 2
	c = 3
	m = 10

	def __init__(self, seed):
		self.x = seed

	def random(self):
		self.x = (self.a * self.x + self.c) % self.m
		return 1.0 * self.x / self.m


class LCG(object):
	a = 2
	c = 3
	m = 10

	def __init__(self, seed):
		self.seed = seed

	def random(self):
		result = (self.a * self.seed + self.c) % self.m
		self.seed = result
		return result / 10.0


class LCG:

	def __init__(self, n):
		self.n = n

	def random(self):
		self.n = (self.n * 2 + 3) % 10
		return self.n / 10


class LCG(object):

	def __init__(self, seed):
		self.seed = seed
		self.multiplier = 2
		self.increment = 3
		self.modulus = 10

	def random(self):
		self.seed = (self.multiplier * self.seed + self.increment) % self.modulus
		return self.seed / self.modulus