wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python syntax errors

Total questions: 30

Worksheet time: 24mins

Name
Class
Date
1.

What is incorrect about this code?

a)

The text should be in double quotation marks

b)

The print function should be all lower case

c)

The string is within the brackets of the print function

d)

They have spelt print incorrectly

2.

What is incorrect about this code?

a)

The text should be in double quotation marks

b)

The print function should be all lower case

c)

The string is within the brackets of the print function

d)

They have spelt print incorrectly

3.

What is incorrect about this code?

a)

The print function should be all lower case

b)

They have spelt print incorrectly

c)

The string should have single quotation marks OR double quotation marks

d)

The string is within the brackets of the print function

4.

In which line is the syntax error?

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4

5.

In which line is the syntax error?

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4

6.

What is incorrect about this code?

a)

The variable Lucky should be all lower case

b)

The print function should be all lower case

c)

The string should be in single quotation marks

d)

They have spelt print incorrectly

7.

In which line is the syntax error?

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4

8.

What is incorrect about this code?

a)

The variable Lucky should have a capital L

b)

The string should be in single quotation marks

c)

The print function should be all lower case

d)

They have spelt print incorrectly

9.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

10.

What is incorrect about this code?

a)

The print function should be all lower case

b)

The variable Lucky should have a capital L

c)

They have spelt print incorrectly

d)

There is no comma between the string and variable

11.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

12.

What is incorrect about this code?

a)

The print function should be all lower case

b)

The string should be in double quotation marks

c)

They have spelt print incorrectly

d)

There is no comma between the string and variable

13.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

14.

What is incorrect about this code?

a)

User is spelt incorrectly

b)

The string should be in double quotation marks

c)

There should not be anything in the input brackets

d)

Input is spelt incorrectly

15.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

16.

What is incorrect about this code?

a)

User is spelt incorrectly

b)

The string should be in quotation marks

c)

There should not be anything in the input brackets

d)

Input is spelt incorrectly

17.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

e)

5

18.

What is incorrect about this code?

a)

User is spelt incorrectly

b)

There should be a colon at the end of the if statement

c)

If should have a lower case “i"

d)

There should be double equal signs

19.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

e)

5

20.

What is incorrect about this code?

a)

User is spelt incorrectly

b)

There should be a colon at the end of the if statement

c)

If should have a lower case “i"

d)

There should be double equal signs

21.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

e)

5

22.

What is incorrect about this code?

a)

else is spelt incorrectly

b)

There should be a colon at the end of the if statement

c)

else should have a lower case “e"

d)

else should not be indented

23.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

e)

5

24.

What is incorrect about this code?

a)

else is spelt incorrectly

b)

There should be a colon at the end of the if statement

c)

else should have a lower case “e"

d)

else should not be indented

25.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

e)

5

26.

What is incorrect about this code?

a)

User is spelt incorrectly

b)

There should be a colon at the end of the if statement

c)

If should have a lower case “i"

d)

There should be double equal signs

27.

In which line is the syntax error?

a)

1

b)

2

c)

3

d)

4

e)

5

28.

What is incorrect about this code?

a)

User is spelt incorrectly

b)

The brackets in input function should be empty

c)

input is spelt incorrectly

d)

The int function should be around the input function

29.

On which line is the int function?

a)

1

b)

2

c)

3

d)

4

30.

Is the code now working correctly?

a)

Yes

b)

No