#!/usr/bin/python3
def celsius_to_fahrenheit(celsius):
	return (celsius * 9 / 5) + 32

def fahrenheit_to_celsius(fahrenheit):
	return (fahrenheit - 32) * 5 / 9

def main():
	scale = input("Θέλεις να δώσεις θερμοκρασία σε C ή F; ").strip().upper()

	if scale not in ['C', 'F']:
		print("Μη έγκυρη επιλογή. Πρέπει να είναι 'C' ή 'F'.")
		return

	try:
		temp = float(input("Δώσε την θερμοκρασία: "))
	except ValueError:
		print("Μη έγκυρη τιμή θερμοκρασίας. Πρέπει να είναι αριθμός.")
		return

	if scale == 'C':
		converted = celsius_to_fahrenheit(temp)
		print(f"{temp:.2f}°C είναι {converted:.2f}°F")
	else:
		converted = fahrenheit_to_celsius(temp)
		print(f"{temp:.2f}°F είναι {converted:.2f}°C")

if __name__ == "__main__":
	main()
