Aug-26-2017, 02:02 AM
Hello
I am trying to run this block of code and I am getting syntex error that says
" File "lopp2.py", line 17
if smallest is None :
^
SyntaxError: invalid syntax"
I am using atom text editor and python 3
I am trying to run this block of code and I am getting syntex error that says
" File "lopp2.py", line 17
if smallest is None :
^
SyntaxError: invalid syntax"
I am using atom text editor and python 3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
largest = None smallest = None while True : try : num = input ( 'Enter a number: ' ) if smallest is None : smallest = num elif num < smallest : smallest = num elif num > smallest largest = num elif num = = 'done' : break except Invalidnum: print ( 'Invalid Input' ) print ( "Maximum" , largest,smallest) |