my code:
Invalid input
Maximum is 10
Minimum is 2
But my output shows:
Invalid input
Maximum is d ← Mismatch
Minimum is o ← Mismatch
d and o are from word done
largest = None smallest = None while True: num = input("Enter a number: ") if num == "done" : break try: num1 = int(num) except ValueError: print('Invalid input') continue for number1 in num: if largest is None: largest = number1 elif largest > number1: largest = number1 print("Maximum is", largest) for number2 in num: if smallest is None: smallest = number2 elif smallest < number2: smallest = number2 print("Minimum is", smallest)My desired output would be if I used 2,8,9,python,4,10 would be:
Invalid input
Maximum is 10
Minimum is 2
But my output shows:
Invalid input
Maximum is d ← Mismatch
Minimum is o ← Mismatch
d and o are from word done
buran write Dec-21-2020, 11:23 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.