number")
if largest is None:
Largest = num
if Largest>num:
print("maximum is " + str(Largest))
I want this code to check and print the maximum in input data. How can i improve it?
max = None while True: try: num = int(input("enter number")) if max == None or num > max: max = num print(f"New max: {max}") except TypeError: print("input a number you dunce")
Обсуждают сегодня