Cheesy Cheeseman just got a new monitor! He is happy with it, but he just discovered that his old desktop wallpaper no longer fits. He wants to find a new wallpaper, but does not know which size wallpaper he should be looking for, and alas, he just threw out the new monitor's box. Luckily he remembers the width and the aspect ratio of the monitor from when Bob Mortimer sold it to him. Can you help Cheesy out?
# The Challenge

Given an integer `width` and a string `ratio` written as `WIDTH:HEIGHT`, output the screen dimensions as a string written as `WIDTHxHEIGHT`.

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def find_screen_height(width, ratio):
	

Solutions:
def find_screen_height(width, ratio):
	(a, b) = map(int, ratio.split(':'))
	return f'{width}x{int(width / a * b)}'


def find_screen_height(width, ratio):
	z = ratio.split(':')
	height = width / int(z[0]) * int(z[1])
	return f'{width}x{int(height)}'


def find_screen_height(width, ratio):
	return f"{width}x{width * int(ratio.split(':')[1]) // int(ratio.split(':')[0])}"


from fractions import Fraction

def find_screen_height(width, ratio):
	ratio = ratio.replace(':', '/')
	ratio = float(sum((Fraction(s) for s in ratio.split())))
	return '{}x{}'.format(width, int(width / ratio))


def find_screen_height(width, ratio):
	r = list(map(int, ratio.split(':')))
	return f'{width}x{width * r[1] // r[0]}'


def find_screen_height(width, ratio):
	(wr, rr) = (int(n) for n in ratio.split(':'))
	return f'{width}x{width * rr // wr}'


def find_screen_height(width: int, ratio: str) -> str:
	(_width_ratio, _height_ratio) = ratio.split(':')
	return f'{width}x{int(width / int(_width_ratio) * int(_height_ratio))}'


def find_screen_height(width, ratio):
	return '{}x{}'.format(width, int(width / int(ratio.split(':')[0]) * int(ratio.split(':')[1])))