193,961 views
3 votes
3 votes
100 POINTS ANSWER CORRECTLY AND ANSWER QUICKLY I DONT HAVE MUCH TIME

You are creating a function that will test whether a number is greater than 10 using these lines of code:
if a < 10:
print(a "is greater than 10")
Can you identify one syntax error and one logic error in these lines? Why do you think a programmer might have made the logic error?

User WebMonster
by
3.2k points

1 Answer

13 votes
13 votes

Yes there's syntax error .

After if there's colon so the next line or code block should start after some spaces(min 4)

The correct code is


\tt def(a)


\tt if\:a<10:


\quad\tt print(a,

User Netmikey
by
3.0k points