0
Why it gives a syntax error?
4 odpowiedzi
+ 5
If you write a try, you also have to write except.
Do it just like this:
def isiteven(number):
if (number % 2 == 0):
return number
else:
raise ValueError
+ 3
Thanks guys. Appreciate it.
+ 2
Because you did not finish the try statement.
try statement should always be followed by except or finally statement, otherwise it has no meaning.
+ 1
HonFu some help here