def cubeInput(): while True: try: l,w,h = (float(input('Lengde: ')), float(input('Bredde: ')), float(input('Høyde: '))) assert w != l and l != h and w != h return (l,w,h) except AssertionError: print('Morten er ikke fornøyd, prøv igjen') except ValueError: print('Det er ikke et tall, prøv igjen') d = min(cubeInput()) print(f'Den største kuben vil ha et volum på {d**3}')