This program tests the life of an
evaporator containing a gas. 

We know the content of the evaporator (content in ml),
the percentage of foam or gas lost every day (evap_per_day)
and the threshold (threshold) in percentage beyond which
the evaporator is no longer useful.
All numbers are strictly positive.

The program reports the nth day (as an integer)
on which the evaporator will be out of use.

**Note** : Content is in fact not necessary in the body of the function "evaporator", you can use it or not use it, as you wish. Some people might prefer to reason with content, some other with percentages only. It's up to you but you must keep it as a parameter because the tests have it as an argument.

Difficulty: EASY
Tags: Fundamentals

Starter code:
def evaporator(content, evap_per_day, threshold):
	

Solutions:
def evaporator(content, evap_per_day, threshold):
	n = 0
	current = 100
	percent = 1 - evap_per_day / 100.0
	while current > threshold:
		current *= percent
		n += 1
	return n


import math

def evaporator(content, evap_per_day, threshold):
	return math.ceil(math.log(threshold / 100.0) / math.log(1.0 - evap_per_day / 100.0))


def evaporator(content, evap_per_day, threshold):
	thresholdper = threshold / 100
	amount_remaining = content
	days = 0
	while amount_remaining / content >= thresholdper:
		amount_remaining = amount_remaining * (1 - evap_per_day / 100)
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	print(content, evap_per_day, threshold)
	i = 0
	c = 1
	while c >= threshold / 100:
		c *= 1 - evap_per_day / 100
		i += 1
	return i


from math import ceil, log

def evaporator(c, e, t):
	return ceil(log(t / 100, 1 - e / 100))


def evaporator(content, evap_per_day, threshold):
	thres = content * threshold / 100
	count = 0
	while content > thres:
		content = content - content * evap_per_day / 100
		count += 1
	return count


def evaporator(content, evap_per_day, threshold):
	limit = content * threshold / 100
	days = 0
	while content > limit:
		days += 1
		content = content - content * evap_per_day / 100
	return days


from math import log2, ceil

def evaporator(content, evap_per_day, threshold):
	return ceil(log2(threshold / 100.0) / log2(1 - evap_per_day / 100.0))


def evaporator(content, evap_per_day, threshold):
	day = 0
	p = content / 100 * threshold
	while content >= p:
		day += 1
		perc = content / 100 * evap_per_day
		content -= perc
	return day


from math import log

def evaporator(_content, evap_per_day, threshold):
	return int(log(threshold / 100, 1 - evap_per_day / 100) + 1)


def evaporator(initial_volume, evap_per_day, threshold):
	threshold = float(threshold)

	def loop(current_volume):
		if is_below_threshold(current_volume):
			return 0
		else:
			return 1 + loop(decrement_volume(current_volume))

	def decrement_volume(current_volume):
		return current_volume * (1 - evap_per_day / 100.0)

	def is_below_threshold(current_volume):
		return current_volume / initial_volume < threshold / 100.0
	return loop(float(initial_volume))


def evaporator(content, evap_per_day, threshold):
	d = 0
	p = content / 100 * threshold
	while content > p:
		content = content - content / 100 * evap_per_day
		d += 1
	return d


def evaporator(c, e, t):
	tc = 100
	count = 0
	while tc > t:
		tc -= tc * (e / 100)
		count += 1
	return count


def evaporator(content, evap_per_day, threshold):
	day = 0
	maxUse = content * (threshold / 100)
	evap = evap_per_day / 100
	while content > maxUse:
		content = content - content * evap
		day += 1
	return day


def evaporator(content, evap, threshold):
	days = 0
	lost = 100
	while lost >= threshold:
		lost -= lost * evap / 100
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	day_counter = 0
	turn_off_level = content * (threshold / 100)
	while content > turn_off_level:
		content = content * (1 - evap_per_day / 100)
		day_counter += 1
	return day_counter
evaporator(10, 10, 10)


def evaporator(content, evap_per_day, threshold):
	t = content * threshold / 100
	counter = 0
	while content >= t:
		content = content - content * evap_per_day / 100
		counter += 1
	return counter


def evaporator(content, evap_per_day, threshold):
	days = 1
	new_content = content
	while True:
		new_content = new_content - new_content * evap_per_day * 0.01
		if new_content / content < threshold * 0.01:
			return days
		else:
			days += 1


def evaporator(content, evap_per_day, threshold):
	critical_amount = threshold / 100 * content
	n = 0
	while content >= critical_amount:
		content = content - content * (evap_per_day / 100)
		n += 1
	return n


import math

def evaporator(content, evap_per_day, threshold):
	percent_loss = 1 - evap_per_day / 100
	x = math.log(threshold / 100) / math.log(percent_loss)
	x = math.ceil(x)
	return x


def evaporator(content, evap_per_day, threshold):
	content_aux = content * threshold / 100
	days = 0
	while content > content_aux:
		content -= content * evap_per_day / 100
		days += 1
	return days


def evaporator(content, evap, threshold):
	day = 0
	pos = content * threshold / 100
	while pos < content:
		content = content - content * evap / 100
		day = day + 1
	return day


def evaporator(content, evap_per_day, threshold):
	new_content = content
	thresh_quant = content * threshold / 100
	n_day_expire = 0
	while new_content > thresh_quant:
		new_content = new_content - new_content * (evap_per_day / 100)
		n_day_expire += 1
	return n_day_expire


def evaporator(content, evap_per_day, threshold):
	day = 0
	threshold = threshold * content / 100
	while content > threshold:
		content -= content * evap_per_day / 100
		day += 1
	return day


def evaporator(content, evap_per_day, threshold):
	rem = content * 0.01 * threshold
	count = 0
	while content >= rem:
		content -= content * 0.01 * evap_per_day
		count += 1
	return count


def evaporator(content, evap_per_day, threshold):
	a = int(content)
	b = 0
	while content > a / 100 * threshold:
		content = content - content / 100 * evap_per_day
		b += 1
	return b


def evaporator(content, evap_per_day, threshold):
	n = 0
	perc = 100
	perc_per_day = 1 - evap_per_day / 100
	while perc > threshold:
		perc *= perc_per_day
		n += 1
	return n


def evaporator(content, evap_per_day, threshold):
	a = 0
	threshold *= content / 100
	while content >= threshold:
		a += 1
		content *= 1 - evap_per_day / 100
	return a


def evaporator(content, evap_per_day, threshold):
	i = 0
	threshold = threshold * 0.01 * content
	while content > threshold:
		i += 1
		content -= content * evap_per_day * 0.01
	return i


def evaporator(content, e_p_d, thresh):
	n = 0
	start_ = 100
	per_ = 1 - e_p_d / 100.0
	while start_ > thresh:
		start_ *= per_
		n += 1
	return n


def evaporator(content, evap_per_day, threshold):
	cday = 0
	left = content
	while left > content * (threshold / 100):
		left = left - left * (evap_per_day / 100)
		cday += 1
	return cday


def evaporator(content, evap_per_day, threshold):
	result = 0
	percent_change = 100
	while percent_change > threshold:
		percent_change -= percent_change * (evap_per_day / 100)
		result = result + 1
	return result


def percent_convert(num):
	return num / 100

def evaporator(content, evap_per_day, threshold):
	content = 1
	evap_per_day = percent_convert(evap_per_day)
	threshold = percent_convert(threshold)
	day_counter = 0
	while content > threshold:
		content = content * (1 - evap_per_day)
		day_counter += 1
	return day_counter


def evaporator(content, evap_per_day, threshold):
	day_count = 0
	percentage_to_ml = content * threshold / 100
	while content >= percentage_to_ml:
		day_count += 1
		content -= content * evap_per_day / 100
	return day_count


def evaporator(content, evap_per_day, threshold):
	days = 0
	current = content
	while content * threshold / 100 < current:
		current *= 1 - evap_per_day / 100
		days += 1
	return days


def evaporator(content, evap, threshold):
	ilosc = 100
	day = 0
	while ilosc > threshold:
		ilosc = ilosc * (1 - evap / 100)
		day += 1
	return day


def evaporator(content, evap_per_day, threshold):
	result = 0
	n = content * threshold / 100
	while content > n:
		content = content - content * evap_per_day / 100
		result += 1
	return result


def evaporator(content, evap_per_day, threshold):
	x = 0
	y = content
	while y > content * (threshold / 100):
		y = y - y * (evap_per_day / 100)
		x = x + 1
	return x


def evaporator(content, evap_per_day, threshold):
	remain = 100.0
	day = 0
	while True:
		day += 1
		remain = remain * (100.0 - evap_per_day) / 100.0
		if remain <= threshold:
			return day


import math

def evaporator(content, e, t):
	return math.ceil(math.log(t / 100) / math.log(1 - e / 100))


def evaporator(content, evap_per_day, threshold):
	perc = 100
	days = 0
	while perc > threshold:
		perc = perc * (1 - evap_per_day / 100)
		days += 1
	return days


def evaporator(a, b, c):
	b /= 100
	a_origin = a
	rem = a_origin
	day = 0
	trsh = c / 100
	while rem >= trsh:
		day += 1
		pr = a * b
		a -= pr
		rem = a / a_origin
	return day


def evaporator(content, evap_per_day, threshold):
	c = 0
	r = 1
	while threshold / 100 < r:
		r -= evap_per_day / 100 * r
		c += 1
	return c


def evaporator(content, evap_per_day, threshold):
	critical = content * threshold / 100
	days = 0
	while content > critical:
		days += 1
		content -= content * evap_per_day / 100
	return days


def evaporator(content, evap_per_day, threshold):
	p = lambda x: (100 - x) / 100
	x = 100
	times = 0
	while x >= threshold:
		x *= p(evap_per_day)
		times += 1
	return times


def evaporator(content, evap_per_day, threshold):
	n = 0
	ct = content * (threshold / 100)
	while content > ct:
		content -= content * (evap_per_day / 100)
		n += 1
	return n


def evaporator(content, evap_per_day, treshold, original=None):
	if not original:
		original = content
	if content > original * treshold / 100:
		content *= 1 - evap_per_day / 100
		return 1 + evaporator(content, evap_per_day, treshold, original)
	return 0


def evaporator(content, evap_per_day, threshold):
	evap_per_day = evap_per_day / 100
	threshold = threshold / 100
	days = 0
	min_content = content * threshold
	while content >= min_content:
		content -= content * evap_per_day
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	days = 0
	perc_content = 100
	new_content = content
	while perc_content > threshold:
		perct_evp = evap_per_day / 100 * new_content
		print(perct_evp)
		new_content = new_content - perct_evp
		print(new_content)
		perc_content = new_content / content * 100
		print(perc_content)
		days += 1
	return days


def evaporator(x, y, z):
	content = x
	evap_per_day = y / 100
	treshold = z / 100
	days = 0
	min_content = content * treshold
	while content >= min_content:
		content -= content * evap_per_day
		days += 1
	return days


def evaporator(x, y, z):
	content = x
	evap_per_day = y
	treshold = z
	perc_th = treshold / 100
	perc_evap = evap_per_day / 100
	min_content = content * perc_th
	total_days = 0
	while content >= min_content:
		content -= content * perc_evap
		total_days += 1
	return total_days


def evaporator(content, evap_per_day, threshold):
	q_threshold = content * threshold / 100
	days = 0
	while content >= q_threshold:
		q_evap_per_day = content * evap_per_day / 100
		content = content - q_evap_per_day
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	day = []
	not_useful = content * (threshold / 100)
	while content >= not_useful:
		content -= evap_per_day / 100 * content
		day.append(content)
	return len(day)


from itertools import count

def evaporator(content, evap_per_day, threshold):
	percentage = 100
	for day in count(start=1):
		percentage = percentage * (1 - evap_per_day / 100)
		if percentage < threshold:
			return day


def evaporator(content, evap_per_day, threshold):
	days = 0
	threshold_in_ml = content * threshold / 100
	while content > threshold_in_ml:
		days += 1
		content = content - content * evap_per_day / 100
	return days


def evaporator(content, evap_per_day, threshold):
	percentage = 100
	for day in range(10000):
		percentage = percentage * (1 - evap_per_day / 100)
		if percentage < threshold:
			return day + 1


def evaporator(content, evap_per_day, threshold):
	counter_days = 0
	full = 100
	while full > threshold:
		full -= full * (evap_per_day / 100)
		counter_days += 1
	return counter_days


def evaporator(content, evap_per_day, threshold):
	mlimit = content * (threshold / 100)
	days = 0
	while content > mlimit:
		content -= content * (evap_per_day / 100)
		days += 1
		print(content)
	return days


def evaporator(content, evap_per_day, threshold):
	n = 0
	daily_content = content
	threshold_vol = threshold / 100 * content
	while daily_content > threshold_vol:
		daily_content = daily_content - evap_per_day / 100 * daily_content
		n += 1
	print(f'The {n}th day the evaporator is useless')
	return n


def evaporator(content, evap_per_day, threshold):
	evap_per_day = evap_per_day / 100
	threshold = content * (threshold / 100)
	total = content
	days = 0
	while total > threshold:
		total -= total * evap_per_day
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	count = 0
	og = content
	while og * threshold / 100 < content:
		content -= content * evap_per_day / 100
		count += 1
	return count


def evaporator(content, evap, threshold):
	counter = 0
	threshold = content * (threshold / 100)
	evap = evap / 100
	while content >= threshold:
		content -= content * evap
		counter += 1
	return counter


def evaporator(content, evap_per_day, threshold):
	days = 0
	thrshld = content * threshold / 100
	while content >= thrshld:
		content -= content * evap_per_day / 100
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	days = 0
	contentLeft = content
	while contentLeft > content * (threshold / 100):
		contentLeft = contentLeft * (1 - evap_per_day / 100)
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	maxthresh = content * threshold / 100
	amountevaporated = 0
	days = 0
	while content > maxthresh:
		percentage = evap_per_day / 100
		content = content - content * percentage
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	percent_of_content = 1
	days = 0
	while percent_of_content > threshold * 0.01:
		days += 1
		percent_of_content -= percent_of_content * evap_per_day * 0.01
	return days


def evaporator(content, evap_per_day, threshold):
	days = 0
	minimum = content * threshold / 100
	while content > minimum:
		days += 1
		content -= content * evap_per_day / 100
	return days


def evaporator(content, evap_per_day, threshold):
	new_content = content
	for x in range(1, 1000):
		new_content = new_content - new_content * (evap_per_day / 100)
		if new_content < content * threshold / 100:
			return x


def evaporator(content, evap_per_day, threshold):
	total = 0
	threshold = content * (threshold / 100)
	evap_per_day = evap_per_day / 100
	while content > threshold:
		ev = content * evap_per_day
		content = content - ev
		total += 1
	return total


def evaporator(content, evap_per_day, threshold):
	content_pct = 100
	days = 0
	while content_pct > threshold:
		content_pct -= evap_per_day * content_pct / 100.0
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	n = 0
	f = 100
	while f > threshold:
		f *= 1 - evap_per_day / 100
		n += 1
	return n


def evaporator(content, evap_per_day, threshold):
	n = 0
	x = 1 - evap_per_day / 100
	while x > threshold / 100:
		x = x * (1 - evap_per_day / 100)
		n = n + 1
	return n + 1


def evaporator(content, evap_per_day, threshold):
	content = 100
	t = threshold / 100 * content
	epd = evap_per_day / 100
	n = 0
	while content > threshold:
		n += 1
		content *= 1 - epd
	return n


def evaporator(co, ev, th):
	x = co * (th / 100)
	day = 0
	while co > x:
		co = co - co * (ev / 100)
		day += 1
	return day


def evaporator(content, evap_per_day, threshold):
	days = 0
	currentLt = content
	while currentLt >= content * threshold / 100.0:
		currentLt = currentLt * (1 - evap_per_day / 100.0)
		days += 1
	return days


import numpy as np

def evaporator(content, evap_per_day, threshold):
	return np.ceil(np.log(threshold / 100) / np.log(1 - evap_per_day / 100))


def evaporator(content, evap_per_day, threshold):
	days = 0
	volume_threshold = content * (threshold / 100)
	while content > volume_threshold:
		content -= content * (evap_per_day / 100)
		days += 1
	return days


def evaporator(content, evap_per_day, threshold):
	limit = content * threshold / 100
	evap = evap_per_day / 100
	c = 0
	while content > limit:
		content = content - content * evap
		c += 1
	return c


def evaporator(content, evap_per_day, threshold):
	e = evap_per_day / 100
	t = threshold / 100
	h = content * t
	days = 0
	while content > h:
		content = content * (1 - e)
		days += 1
	return days